差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン | ||
ja:documentation:07_technical_annexes:19_mysql_8 [2023/01/31 05:46] – [Rocky Linux 8/AlmaLinux 8/RHEL 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: | ||
- | |||
- | ===== 前提条件 ===== | ||
- | |||
- | <WRAP center round important 60%> | ||
- | |||
- | To migrate from MySQL 5.7 to MySQL 8 you must be upgraded to at least PFMS **version NG 760 MR 52**. | ||
- | |||
- | </ | ||
- | |||
- | <WRAP center round important 60%> | ||
- | |||
- | MySQL 5.7 から MySQL 8 へマイグレートするには、少なくとも Pandora FMS **バージョン NG 760 MR 52** へアップグレードする必要があります。 | ||
- | |||
- | </ | ||
- | |||
- | * Open a terminal window with the **root** | ||
- | |||
- | * **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: | ||
- | |||
- | * Pandora FMS サーバと Pandora FMS ソフトウエアエージェントを停止します。 | ||
- | < | ||
- | |||
- | / | ||
- | / | ||
- | |||
- | </ | ||
- | |||
- | * Stop the Apache web server: | ||
- | |||
- | * Apache Web サーバを停止します。 | ||
- | < | ||
- | systemctl stop httpd.service | ||
- | |||
- | </ | ||
- | |||
- | Either: | ||
- | |||
- | または、 | ||
- | |||
- | < | ||
- | / | ||
- | |||
- | </ | ||
- | |||
- | * Make a special database backup that is compatible with MySQL 8: | ||
- | |||
- | * MySQL 8 に互換性がある特別なデータベースバックアップを作成します。 | ||
- | < | ||
- | mysqldump -u root -p pandora \ | ||
- | --skip-add-drop-table \ | ||
- | --complete-insert \ | ||
- | --no-create-info > backup_pandora.sql | ||
- | |||
- | </ | ||
- | |||
- | * Make a backup as it is done in MySQL 5.7 (an additional insurance if you have to go back to this version): | ||
- | |||
- | * MySQL 5.7 での通常のバックアップを作成します。(このバージョンに戻す場合の追加の保険です) | ||
- | < | ||
- | mysqldump -u root -p pandora > backup_pandora_5.7.sql | ||
- | |||
- | </ | ||
- | |||
- | * Back up the MySQL configuration file ('' | ||
- | |||
- | * MySQL 設定ファイル('' | ||
- | < | ||
- | cp /etc/my.cnf / | ||
- | |||
- | </ | ||
- | |||
- | * Delete the Percona 5 repositories: | ||
- | |||
- | * Percona 5 リポジトリを削除します。 | ||
- | < | ||
- | rpm -qa | grep Percona-Server | xargs rpm -e --nodeps | ||
- | |||
- | </ | ||
- | |||
- | * Install the Percona 8 repositories: | ||
- | |||
- | * Percona 8 リポジトリをインストールします。 | ||
- | < | ||
- | |||
- | yum install https:// | ||
- | |||
- | </ | ||
- | |||
- | * Enable the repositories from the previous step: | ||
- | |||
- | * 前述のリポジトリを有効化します。 | ||
- | < | ||
- | percona-release setup ps80 | ||
- | |||
- | </ | ||
- | |||
- | * Install Percona 8 | ||
- | |||
- | * 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 " | ||
- | |||
- | </ | ||
- | |||
- | * If **you do not have an HA environment**, | ||
- | |||
- | * **HA 環境が無い場合**は、'' | ||
- | |||
- | < | ||
- | skip-log-bin | ||
- | |||
- | </ | ||
- | |||
- | <WRAP center round tip 60%> | ||
- | |||
- | See also " | ||
- | |||
- | </ | ||
- | |||
- | <WRAP center round tip 60%> | ||
- | |||
- | '' | ||
- | |||
- | </ | ||
- | |||
- | * Start the MySQL service: | ||
- | |||
- | * MySQL サービスを起動します。 | ||
- | < | ||
- | 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 のコマンドラインで、 | ||
- | * '' | ||
- | * 新たな '' | ||
- | * '' | ||
- | * データをインポートします。 | ||
- | * 特別な MySQL 8 互換バックアップをインポートします。 | ||
- | |||
- | < | ||
- | mysql -u root -p pandora | ||
- | |||
- | </ | ||
- | |||
- | < | ||
- | drop database pandora; | ||
- | create database pandora; | ||
- | use pandora; | ||
- | source / | ||
- | source backup_pandora.sql; | ||
- | |||
- | </ | ||
- | |||
- | * The necessary permissions (grants) must be added again; //if you are not logged in// to '' | ||
- | |||
- | * 必要なアクセス許可を再度追加する必要があります。 '' | ||
- | |||
- | < | ||
- | mysql -u root -p < | ||
- | |||
- | </ | ||
- | |||
- | * **Once logged in as root execute the following commands:** | ||
- | * Deactivate the password validation plugin (optional). | ||
- | |||
- | * **root としてログインしてら次のコマンドを実行します。** | ||
- | * パスワード検証プラグインを無効にします(オプション)。 | ||
- | |||
- | < | ||
- | UNINSTALL COMPONENT ' | ||
- | |||
- | </ | ||
- | |||
- | * Create the login user if it does not exist: | ||
- | |||
- | * ログインユーザが存在しない場合は作成します。 | ||
- | |||
- | < | ||
- | CREATE USER "< | ||
- | |||
- | </ | ||
- | |||
- | <WRAP center round tip 60%> | ||
- | |||
- | // | ||
- | |||
- | </ | ||
- | |||
- | <WRAP center round tip 60%> | ||
- | |||
- | // | ||
- | |||
- | </ | ||
- | |||
- | * Assign the native password for '' | ||
- | |||
- | * '' | ||
- | |||
- | < | ||
- | ALTER USER "< | ||
- | |||
- | </ | ||
- | |||
- | * Grant grants on Pandora FMS database ('' | ||
- | |||
- | * Pandora FMS データベース('' | ||
- | |||
- | < | ||
- | GRANT ALL PRIVILEGES ON pandora.* TO "< | ||
- | |||
- | </ | ||
- | |||
- | * Save the changes and exit: | ||
- | |||
- | * 変更を保存して抜けます。 | ||
- | |||
- | < | ||
- | flush privileges; | ||
- | exit | ||
- | |||
- | </ | ||
- | |||
- | Once you have finished working with the database, perform the following steps: | ||
- | |||
- | データベースの対応が完了したら、次のステップを実行します。 | ||
- | |||
- | * Start the PFMS server and the PFMS Software Agent: | ||
- | |||
- | * Pandora FMS サーバおよび Pandora FMS ソフトウエアエージェントを起動します。 | ||
- | < | ||
- | / | ||
- | / | ||
- | |||
- | </ | ||
- | |||
- | * Stop the Apache web server: | ||
- | |||
- | * Apache Web サーバを起動します。 | ||
- | < | ||
- | systemctl start httpd.service | ||
- | |||
- | </ | ||
- | |||
- | Either: | ||
- | |||
- | または、 | ||
- | |||
- | < | ||
- | / | ||
- | |||
- | </ | ||
- | |||
- | ===== Rocky Linux 8/AlmaLinux 8/RHEL 8 ===== | ||
- | |||
- | * Stop the PFMS server and the PFMS Software Agent: | ||
- | |||
- | * Pandora FMS サーバおよび Pandora FMS ソフトウエアエージェントを停止します。 | ||
- | < | ||
- | / | ||
- | / | ||
- | |||
- | </ | ||
- | |||
- | * Stop the Apache web server: | ||
- | |||
- | * Apache web サーバを停止します。 | ||
- | < | ||
- | systemctl stop httpd.service | ||
- | |||
- | </ | ||
- | |||
- | Either: | ||
- | |||
- | または、 | ||
- | |||
- | < | ||
- | / | ||
- | |||
- | </ | ||
- | |||
- | * Make a special database backup that is compatible with MySQL 8: | ||
- | |||
- | * 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): | ||
- | |||
- | * MySQL 5.7 での通常のバックアップを作成します。(このバージョンに戻す場合の追加の保険です。) | ||
- | < | ||
- | mysqldump -u root -p pandora > backup_pandora_5.7.sql | ||
- | |||
- | </ | ||
- | |||
- | * Back up the MySQL configuration file ('' | ||
- | |||
- | * MySQL 設定ファイル('' | ||
- | < | ||
- | cp /etc/my.cnf / | ||
- | |||
- | </ | ||
- | |||
- | * Delete the Percona 5 repositories: | ||
- | |||
- | * Percona 5 リポジトリを削除します。 | ||
- | < | ||
- | rpm -qa | grep Percona-Server | xargs rpm -e --nodeps | ||
- | |||
- | </ | ||
- | |||
- | * Install the Percona 8 repositories: | ||
- | |||
- | * Percona 8 リポジトリをインストールします。 | ||
- | < | ||
- | |||
- | dnf install https:// | ||
- | |||
- | </ | ||
- | |||
- | * Enable the repositories from the previous step: | ||
- | |||
- | * 前述のリポジトリを有効化します。 | ||
- | < | ||
- | percona-release setup ps80 | ||
- | |||
- | </ | ||
- | |||
- | * Install Percona 8 | ||
- | |||
- | * 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 " | ||
- | |||
- | </ | ||
- | |||
- | * If **you do not have an HA environment**, | ||
- | |||
- | * **HA 環境が無い場合**は、'' | ||
- | |||
- | < | ||
- | skip-log-bin | ||
- | |||
- | </ | ||
- | |||
- | <WRAP center round tip 60%> | ||
- | |||
- | See also " | ||
- | |||
- | </ | ||
- | |||
- | * Start the MySQL service: | ||
- | |||
- | * MySQL サービスを起動します。 | ||
- | < | ||
- | 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 のコマンドラインで、 | ||
- | * '' | ||
- | * 新たな '' | ||
- | * '' | ||
- | * データをインポートします。 | ||
- | * 特別な MySQL 8 互換バックアップをインポートします。 | ||
- | |||
- | < | ||
- | # mysql -u root -p pandora | ||
- | > drop database pandora; | ||
- | > create database pandora; | ||
- | > use pandora; | ||
- | > source / | ||
- | > source backup_pandora.sql; | ||
- | |||
- | </ | ||
- | |||
- | * Start the PFMS server and the PFMS Software Agent: | ||
- | |||
- | * Pandora FMS サーバおよび Pandora FMS ソフトウエアエージェントを起動します。 | ||
- | < | ||
- | / | ||
- | / | ||
- | |||
- | </ | ||
- | |||
- | * Stop the Apache web server: | ||
- | |||
- | * Apache web サーバを起動します。 | ||
- | < | ||
- | systemctl start httpd.service | ||
- | |||
- | </ | ||
- | |||
- | Either: | ||
- | |||
- | または、 | ||
- | |||
- | < | ||
- | / | ||
- | |||
- | </ | ||
- | |||
- | [[ja: | ||
- | |||