差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン | ||
ja:documentation:07_technical_annexes:19_mysql_8 [2022/06/08 12:39] – [Upgrading from MySQL 5.7 to MySQL 8] junichi | ja:documentation:07_technical_annexes:19_mysql_8 [Unknown date] (現在) – 削除 - 外部編集 (Unknown date) 127.0.0.1 | ||
---|---|---|---|
行 1: | 行 1: | ||
- | ====== MySQL 5.7 から MySQL 8 へのアップグレード ====== | ||
- | |||
- | {{indexmenu_n> | ||
- | |||
- | [[ja: | ||
- | |||
- | ===== Prerequisites ===== | ||
- | |||
- | * Open a terminal window with the **root** | ||
- | < | ||
- | |||
- | mysql --version | ||
- | |||
- | </ | ||
- | |||
- | You will get an answer similar to the following: | ||
- | |||
- | < | ||
- | mysql Ver 14.14 Distrib 5.7.33, for Linux (x86_64) using EditLine wrapper | ||
- | |||
- | </ | ||
- | |||
- | * Perform a data backup procedure. See " | ||
- | |||
- | ===== CentOS 7 ===== | ||
- | |||
- | * Stop the PFMS server and the PFMS Software Agent: | ||
- | < | ||
- | |||
- | / | ||
- | / | ||
- | |||
- | </ | ||
- | |||
- | * Stop the Apache web server: | ||
- | |||
- | < | ||
- | systemctl stop httpd.service | ||
- | |||
- | </ | ||
- | |||
- | Either: | ||
- | |||
- | < | ||
- | / | ||
- | |||
- | </ | ||
- | |||
- | * Make a special database backup that is compatible with MySQL 8: | ||
- | |||
- | < | ||
- | mysqldump -u root -p pandora \ | ||
- | --skip-add-drop-table \ | ||
- | --complete-insert \ | ||
- | --no-create-info> | ||
- | |||
- | </ | ||
- | |||
- | * Make a backup as it is done in MySQL 5.7 (an additional insurance if you have to go back to this version): | ||
- | |||
- | < | ||
- | mysqldump -u root -p pandora> backup_pandora_5.7.sql | ||
- | |||
- | </ | ||
- | |||
- | * Back up the MySQL configuration file ('' | ||
- | |||
- | < | ||
- | cp /etc/my.cnf / | ||
- | |||
- | </ | ||
- | |||
- | * Delete the Percona 5 repositories: | ||
- | |||
- | < | ||
- | rpm -qa | grep Percona-Server | xargs rpm -e --nodeps | ||
- | |||
- | </ | ||
- | |||
- | * Install the Percona 8 repositories: | ||
- | < | ||
- | |||
- | yum install https:// | ||
- | |||
- | </ | ||
- | |||
- | * Enable the repositories from the previous step: | ||
- | |||
- | < | ||
- | percona-release setup ps80 | ||
- | |||
- | </ | ||
- | |||
- | * Install Percona 8 | ||
- | |||
- | < | ||
- | yum install percona-server-server | ||
- | |||
- | </ | ||
- | |||
- | * Restore the file '' | ||
- | |||
- | < | ||
- | mv / | ||
- | |||
- | </ | ||
- | |||
- | * Modify the '' | ||
- | |||
- | < | ||
- | sed -i -e " | ||
- | sed -i -e " | ||
- | sed -i -e " | ||
- | sed -i -e " | ||
- | |||
- | </ | ||
- | |||
- | * Start the MySQL service: | ||
- | |||
- | < | ||
- | systemctl start mysql | ||
- | |||
- | </ | ||
- | |||
- | or: | ||
- | |||
- | < | ||
- | service mysqld start | ||
- | |||
- | </ | ||
- | |||
- | * Verify the version installed with: | ||
- | |||
- | < | ||
- | mysql --version | ||
- | |||
- | </ | ||
- | |||
- | You will get an answer similar to the following: | ||
- | |||
- | < | ||
- | mysql Ver 8.0.28-19 for Linux on x86_64 (Percona Server (GPL), Release 19, Revision 31e88966cd3) | ||
- | |||
- | </ | ||
- | |||
- | * Now use MySQL' | ||
- | * Delete the '' | ||
- | * Create a new '' | ||
- | * Open the '' | ||
- | * Import the data that special MySQL 8 compatible backup. | ||
- | |||
- | < | ||
- | # mysql -u root -p pandora> drop database pandora;> | ||
- | > source backup_pandora.sql; | ||
- | |||
- | </ | ||
- | |||
- | * Start the PFMS server and the PFMS Software Agent: | ||
- | |||
- | < | ||
- | / | ||
- | / | ||
- | |||
- | </ | ||
- | |||
- | * Stop the Apache web server: | ||
- | |||
- | < | ||
- | systemctl start httpd.service | ||
- | |||
- | </ | ||
- | |||
- | Either: | ||
- | |||
- | < | ||
- | / | ||
- | |||
- | </ | ||
- | |||
- | ===== Rocky Linux 8/AlmaLinux 8/RHEL 8 ===== | ||
- | |||
- | * Stop the PFMS server and the PFMS Software Agent: | ||
- | |||
- | < | ||
- | / | ||
- | / | ||
- | |||
- | </ | ||
- | |||
- | * Stop the Apache web server: | ||
- | |||
- | < | ||
- | systemctl stop httpd.service | ||
- | |||
- | </ | ||
- | |||
- | Either: | ||
- | |||
- | < | ||
- | / | ||
- | |||
- | </ | ||
- | |||
- | * Make a special database backup that is compatible with MySQL 8: | ||
- | |||
- | < | ||
- | mysqldump -u root -p pandora \ | ||
- | --skip-add-drop-table \ | ||
- | --complete-insert \ | ||
- | --no-create-info> | ||
- | |||
- | </ | ||
- | |||
- | * Make a backup as it is done in MySQL 5.7 (an additional insurance if you have to go back to this version): | ||
- | |||
- | < | ||
- | mysqldump -u root -p pandora> backup_pandora_5.7.sql | ||
- | |||
- | </ | ||
- | |||
- | * Back up the MySQL configuration file ('' | ||
- | |||
- | < | ||
- | cp /etc/my.cnf / | ||
- | |||
- | </ | ||
- | |||
- | * Delete the Percona 5 repositories: | ||
- | |||
- | < | ||
- | rpm -qa | grep Percona-Server | xargs rpm -e --nodeps | ||
- | |||
- | </ | ||
- | |||
- | * Install the Percona 8 repositories: | ||
- | < | ||
- | |||
- | dnf install https:// | ||
- | |||
- | </ | ||
- | |||
- | * Enable the repositories from the previous step: | ||
- | |||
- | < | ||
- | percona-release setup ps80 | ||
- | |||
- | </ | ||
- | |||
- | * Install Percona 8 | ||
- | |||
- | < | ||
- | dnf install percona-server-server | ||
- | |||
- | </ | ||
- | |||
- | * Restore the file '' | ||
- | |||
- | < | ||
- | mv / | ||
- | |||
- | </ | ||
- | |||
- | * Modify the '' | ||
- | |||
- | < | ||
- | sed -i -e " | ||
- | sed -i -e " | ||
- | sed -i -e " | ||
- | sed -i -e " | ||
- | |||
- | </ | ||
- | |||
- | * Start the MySQL service: | ||
- | |||
- | < | ||
- | systemctl start mysql | ||
- | |||
- | </ | ||
- | |||
- | or: | ||
- | |||
- | < | ||
- | service mysqld start | ||
- | |||
- | </ | ||
- | |||
- | * Verify the version installed with: | ||
- | |||
- | < | ||
- | mysql --version | ||
- | |||
- | </ | ||
- | |||
- | You will get an answer similar to the following: | ||
- | |||
- | < | ||
- | mysql Ver 8.0.28-19 for Linux on x86_64 (Percona Server (GPL), Release 19, Revision 31e88966cd3) | ||
- | |||
- | </ | ||
- | |||
- | * Now use MySQL' | ||
- | * Delete the '' | ||
- | * Create a new '' | ||
- | * Open the '' | ||
- | * Import the data that special MySQL 8 compatible backup. | ||
- | |||
- | < | ||
- | # mysql -u root -p pandora> drop database pandora;> | ||
- | > source backup_pandora.sql; | ||
- | |||
- | </ | ||
- | |||
- | * Start the PFMS server and the PFMS Software Agent: | ||
- | |||
- | < | ||
- | / | ||
- | / | ||
- | |||
- | </ | ||
- | |||
- | * Stop the Apache web server: | ||
- | |||
- | < | ||
- | systemctl start httpd.service | ||
- | |||
- | </ | ||
- | |||
- | Either: | ||
- | |||
- | < | ||
- | / | ||
- | |||
- | </ | ||
- | |||
- | [[: | ||
- | |||