ja:documentation:07_technical_annexes:19_mysql_8

差分

このページの2つのバージョン間の差分を表示します。

この比較画面へのリンク

両方とも前のリビジョン 前のリビジョン
ja:documentation:07_technical_annexes:19_mysql_8 [2023/11/09 07:49] – [Rocky Linux 8/AlmaLinux 8/RHEL 8] junichija:documentation:07_technical_annexes:19_mysql_8 [Unknown date] (現在) – 削除 - 外部編集 (Unknown date) 127.0.0.1
行 1: 行 1:
-====== MySQL 5.7 から MySQL 8 へのアップグレード ====== 
- 
-{{indexmenu_n>19}} 
- 
-[[ja:documentation:start|Pandora FMS ドキュメント一覧に戻る]] 
- 
-===== 前提条件 ===== 
- 
-<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> 
- 
-<WRAP center round important 60%> 
- 
-MySQL 5.7 から MySQL 8 へマイグレートするには、少なくとも Pandora FMS **バージョン NG 760 MR 52** へアップグレードする必要があります。 
- 
-</WRAP> 
- 
-  * Open a terminal window with the **root**  user and enter the following command: 
- 
-  * **root** ユーザにてターミナルウインドウを開き、次のコマンドを実行します。 
-<code> 
- 
-mysql --version 
- 
-</code> 
- 
-You will get an answer similar to the following: 
- 
-次のような出力が得られます。 
- 
-<code> 
-mysql  Ver 14.14 Distrib 5.7.33, for Linux (x86_64) using  EditLine wrapper 
- 
-</code> 
- 
-  * Perform a data backup procedure. See "[[:en:documentation:07_technical_annexes:07_backup_and_restore_procedures|Backup and recovery procedures]]" for details. 
- 
-  * データバックアップ手順を実行します。詳細は、[[:ja:documentation:07_technical_annexes:07_backup_and_restore_procedures|バックアップおよびリストア手順]] を参照してください。 
- 
-===== CentOS 7 ===== 
- 
-  * Stop the PFMS server and the PFMS Software Agent: 
- 
-  * Pandora FMS サーバと Pandora FMS ソフトウエアエージェントを停止します。 
-<code> 
- 
-/etc/init.d/pandora_server stop 
-/etc/init.d/pandora_agent_daemon stop 
- 
-</code> 
- 
-  * Stop the Apache web server: 
- 
-  * Apache Web サーバを停止します。 
-<code> 
-systemctl stop httpd.service 
- 
-</code> 
- 
-Either: 
- 
-または、 
- 
-<code> 
-/etc/init.d/httpd stop 
- 
-</code> 
- 
-  * Make a special database backup that is compatible with MySQL 8: 
- 
-  * MySQL 8 に互換性がある特別なデータベースバックアップを作成します。 
-<code> 
-mysqldump -u root -p pandora \ 
-  --skip-add-drop-table \ 
-  --complete-insert \ 
-  --no-create-info > backup_pandora.sql 
- 
-</code> 
- 
-  * 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 での通常のバックアップを作成します。(このバージョンに戻す場合の追加の保険です) 
-<code> 
-mysqldump -u root -p pandora > backup_pandora_5.7.sql 
- 
-</code> 
- 
-  * Back up the MySQL configuration file (''my.cnf''): 
- 
-  * MySQL 設定ファイル(''my.cnf'')をバックアップします。 
-<code> 
-cp /etc/my.cnf /tmp/my.cnf.BACK 
- 
-</code> 
- 
-  * Delete the Percona 5 repositories: 
- 
-  * Percona 5 リポジトリを削除します。 
-<code> 
-rpm -qa | grep Percona-Server | xargs rpm -e --nodeps 
- 
-</code> 
- 
-  * Install the Percona 8 repositories: 
- 
-  * Percona 8 リポジトリをインストールします。 
-<code> 
- 
-yum install https://repo.percona.com/yum/percona-release-latest.noarch.rpm -y 
- 
-</code> 
- 
-  * Enable the repositories from the previous step: 
- 
-  * 前述のリポジトリを有効化します。 
-<code> 
-percona-release setup ps80 
- 
-</code> 
- 
-  * Install Percona 8 
- 
-  * Percona 8 をインストールします。 
-<code> 
-yum install percona-server-server 
- 
-</code> 
- 
-  * Restore the file ''my.cnf'': 
- 
-  * ''my.cnf'' ファイルをリストアします。 
-<code> 
-mv /tmp/my.cnf.BACK /etc/my.cnf 
- 
-</code> 
- 
-  * Modify the ''my.cnf''  file to dispense with ''query_cache_*'': 
- 
-  * ''query_cache_*'' を無効化するように ''my.cnf'' ファイルを修正します。 
-<code> 
-sed -i -e "s/^query_cache_type.*/#query_cache_type/g" /etc/my.cnf 
-sed -i -e "s/^query_cache_size.*/#query_cache_size/g" /etc/my.cnf 
-sed -i -e "s/^query_cache_min_res_unit.*/#query_cache_min_res_unit/g" /etc/my.cnf 
-sed -i -e "s/^query_cache_limit.*/#query_cache_limit/g" /etc/my.cnf 
- 
-</code> 
- 
-  * If **you do not have an HA environment**, disable the binary logs with the following command in the ''[mysqld]''  section: 
- 
-  * **HA 環境が無い場合**は、''[[mysqld]]'' セクションの次のコマンドでバイナリログを無効化します。 
- 
-<code> 
-skip-log-bin 
- 
-</code> 
- 
-<WRAP center round tip 60%> 
- 
-See also "[[:en:documentation:05_big_environments:08_optimization#check_mycnf_settings|Optimization and troubleshooting]]" for checking the ''my.cnf''  file. 
- 
-</WRAP> 
- 
-<WRAP center round tip 60%> 
- 
-''my.cnf'' ファイルのチェックには、"[[:ja:documentation:05_big_environments:08_optimization#mycnf_設定の確認|最適化と問題解決]]" も参照してください。 
- 
-</WRAP> 
- 
-  * Start the MySQL service: 
- 
-  * MySQL サービスを起動します。 
-<code> 
-systemctl start mysql 
- 
-</code> 
- 
-or: 
- 
-または、 
- 
-<code> 
-service mysqld start 
- 
-</code> 
- 
-  * Verify the version installed with: 
- 
-  * インストールされたバージョンを確認します。 
-<code> 
-mysql --version 
- 
-</code> 
- 
-You will get an answer similar to the following: 
- 
-次のような出力を確認できます。 
- 
-<code> 
-mysql  Ver 8.0.28-19 for Linux on x86_64 (Percona Server (GPL), Release 19, Revision 31e88966cd3) 
- 
-</code> 
- 
-  * Now use MySQL's own command line and: 
-      * Delete the ''pandora''  database. 
-      * Create a new ''pandora''  database. 
-      * Open the ''pandora''  database and import the schema found in the PFMS Web Console. 
-      * Import the data that special MySQL 8 compatible backup. 
- 
-  * MySQL のコマンドラインで、 
-      * ''pandora'' データベースを削除します。 
-      * 新たな ''pandora'' データベースを作成します。 
-      * ''pandora'' データベースを開き、Pandora FMS Web コンソールにあるスキーマをインポートします。 
-      * データをインポートします。 
-      * 特別な MySQL 8 互換バックアップをインポートします。 
- 
-<code> 
-mysql -u root -p pandora 
- 
-</code> 
- 
-<code> 
-drop database pandora; 
-create database pandora; 
-use pandora; 
-source /var/www/html/pandora_console/pandoradb.sql; 
-source backup_pandora.sql; 
- 
-</code> 
- 
-  * The necessary permissions (grants) must be added again; //if you are not logged in//  to ''mysql''  as **root**  user (replace with the corresponding password) run: 
- 
-  * 必要なアクセス許可を再度追加する必要があります。 ''mysql'' に//ログインしていない場合// は、 **root** ユーザ(パスワードは対応するものを利用)として以下を実行します: 
- 
-<code> 
-mysql -u root -p <password> 
- 
-</code> 
- 
-  * **Once logged in as root execute the following commands:** 
-  * Deactivate the password validation plugin (optional). 
- 
-  * **root としてログインしてら次のコマンドを実行します。** 
-  * パスワード検証プラグインを無効にします(オプション)。 
- 
-<code> 
-UNINSTALL COMPONENT 'file://component_validate_password'; 
- 
-</code> 
- 
-  * Create the login user if it does not exist: 
- 
-  * ログインユーザが存在しない場合は作成します。 
- 
-<code> 
-CREATE USER "<DBUSER>"@'%' IDENTIFIED BY "<DBPASS>"; 
- 
-</code> 
- 
-<WRAP center round tip 60%> 
- 
-//**Note**//  : if you want to restrict the IP address of connection to the database, you must change the ''%''  to the IP address of the connection source. 
- 
-</WRAP> 
- 
-<WRAP center round tip 60%> 
- 
-//**注意**// : データベースへの接続 IP アドレスを制限したい場合は、''%'' を接続元の IP アドレスに変更する必要があります。 
- 
-</WRAP> 
- 
-  * Assign the native password for ''mysql'': 
- 
-  * ''mysql'' にネイティブパスワードを設定します。 
- 
-<code> 
-ALTER USER "<DBUSER>"@'%' IDENTIFIED WITH mysql_native_password BY "<DBPASS>"; 
- 
-</code> 
- 
-  * Grant grants on Pandora FMS database (''pandora''): 
- 
-  * Pandora FMS データベース(''pandora'')に対して grant を行います。 
- 
-<code> 
-GRANT ALL PRIVILEGES ON pandora.* TO "<DBUSER>"@'%'; 
- 
-</code> 
- 
-  * Save the changes and exit: 
- 
-  * 変更を保存して抜けます。 
- 
-<code> 
-flush privileges; 
-exit 
- 
-</code> 
- 
-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 ソフトウエアエージェントを起動します。 
-<code> 
-/etc/init.d/pandora_server start 
-/etc/init.d/pandora_agent_daemon start 
- 
-</code> 
- 
-  * Start the Apache web server: 
- 
-  * Apache Web サーバを起動します。 
-<code> 
-systemctl start httpd.service 
- 
-</code> 
- 
-Either: 
- 
-または、 
- 
-<code> 
-/etc/init.d/httpd start 
- 
-</code> 
- 
-===== Rocky Linux 8/AlmaLinux 8/RHEL 8 ===== 
- 
-  * Stop the PFMS server and the PFMS Software Agent: 
- 
-  * Pandora FMS サーバおよび Pandora FMS ソフトウエアエージェントを停止します。 
-<code> 
-/etc/init.d/pandora_server stop 
-/etc/init.d/pandora_agent_daemon stop 
- 
-</code> 
- 
-  * Stop the Apache web server: 
- 
-  * Apache web サーバを停止します。 
-<code> 
-systemctl stop httpd.service 
- 
-</code> 
- 
-Either: 
- 
-または、 
- 
-<code> 
-/etc/init.d/httpd stop 
- 
-</code> 
- 
-  * Make a special database backup that is compatible with MySQL 8: 
- 
-  * MySQL 8 に互換性のある特別なデータベースバックアップを作成します。 
-<code> 
-mysqldump -u root -p pandora \ 
-  --skip-add-drop-table \ 
-  --complete-insert \ 
-  --no-create-info> backup_pandora.sql 
- 
-</code> 
- 
-  * 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 での通常のバックアップを作成します。(このバージョンに戻す場合の追加の保険です。) 
-<code> 
-mysqldump -u root -p pandora > backup_pandora_5.7.sql 
- 
-</code> 
- 
-  * Back up the MySQL configuration file (''my.cnf''): 
- 
-  * MySQL 設定ファイル(''my.cnf'')をバックアップします。 
-<code> 
-cp /etc/my.cnf /tmp/my.cnf.BACK 
- 
-</code> 
- 
-  * Delete the Percona 5 repositories: 
- 
-  * Percona 5 リポジトリを削除します。 
-<code> 
-rpm -qa | grep Percona-Server | xargs rpm -e --nodeps 
- 
-</code> 
- 
-  * Install the Percona 8 repositories: 
- 
-  * Percona 8 リポジトリをインストールします。 
-<code> 
- 
-dnf install https://repo.percona.com/yum/percona-release-latest.noarch.rpm -y 
- 
-</code> 
- 
-  * Enable the repositories from the previous step: 
- 
-  * 前述のリポジトリを有効化します。 
-<code> 
-percona-release setup ps80 
- 
-</code> 
- 
-  * Install Percona 8 
- 
-  * Percona 8 をインストールします。 
-<code> 
-dnf install percona-server-server 
- 
-</code> 
- 
-  * Restore the file ''my.cnf'': 
- 
-  * ''my.cnf'' ファイルをリストアします。 
-<code> 
-mv /tmp/my.cnf.BACK /etc/my.cnf 
- 
-</code> 
- 
-  * Modify the ''my.cnf''  file to dispense with ''query_cache_*'': 
- 
-  * ''query_cache_*'' を無効化するために ''my.cnf'' を修正します。 
-<code> 
-sed -i -e "s/^query_cache_type.*/#query_cache_type/g" /etc/my.cnf 
-sed -i -e "s/^query_cache_size.*/#query_cache_size/g" /etc/my.cnf 
-sed -i -e "s/^query_cache_min_res_unit.*/#query_cache_min_res_unit/g" /etc/my.cnf 
-sed -i -e "s/^query_cache_limit.*/#query_cache_limit/g" /etc/my.cnf 
- 
-</code> 
- 
-  * If **you do not have an HA environment**, disable the binary logs with the following command in the ''[mysqld]''  section: 
- 
-  * **HA 環境が無い場合**は、''[mysqld]'' セクションの次のコマンドでバイナリログを無効化します。 
- 
-<code> 
-skip-log-bin 
- 
-</code> 
- 
-<WRAP center round tip 60%> 
- 
-See also "[[:en:documentation:05_big_environments:08_optimization#check_mycnf_settings|Optimization and troubleshooting]]" for checking the ''my.cnf''  file. 
- 
-</WRAP> 
- 
-<WRAP center round tip 60%> 
- 
-''my.cnf'' ファイルのチェックには、"[[:ja:documentation:05_big_environments:08_optimization#mycnf_設定の確認|最適化と問題解決]]" も参照してください。 
- 
-</WRAP> 
- 
-  * Start the MySQL service: 
- 
-  * MySQL サービスを起動します。 
-<code> 
-systemctl start mysql 
- 
-</code> 
- 
-or: 
- 
-または、 
- 
-<code> 
-service mysqld start 
- 
-</code> 
- 
-  * Verify the version installed with: 
- 
-  * インストールされたバージョンを確認します。 
-<code> 
-mysql --version 
- 
-</code> 
- 
-You will get an answer similar to the following: 
- 
-次のような出力が見られます。 
- 
-<code> 
-mysql  Ver 8.0.28-19 for Linux on x86_64 (Percona Server (GPL), Release 19, Revision 31e88966cd3) 
- 
-</code> 
- 
-  * Now use MySQL's own command line and: 
-      * Delete the ''pandora''  database. 
-      * Create a new ''pandora''  database. 
-      * Open the ''pandora''  database and import the schema found in the PFMS Web Console. 
-      * Import the data that special MySQL 8 compatible backup. 
- 
-  * MySQL のコマンドラインで、 
-      * ''pandora'' データベースを削除します。 
-      * 新たな ''pandora'' データベースを作成します。 
-      * ''pandora'' データベースを開き、Pandora FMS Web コンソールにあるスキーマをインポートします。 
-      * データをインポートします。 
-      * 特別な MySQL 8 互換バックアップをインポートします。 
- 
-<code> 
-mysql -u root -p pandora 
- 
-</code> 
- 
-<code> 
-drop database pandora; 
-create database pandora; 
-use pandora; 
-source /var/www/html/pandora_console/pandoradb.sql; 
-source backup_pandora.sql; 
- 
-</code> 
- 
-  * Start the PFMS server and the PFMS Software Agent: 
- 
-  * Pandora FMS サーバおよび Pandora FMS ソフトウエアエージェントを起動します。 
-<code> 
-/etc/init.d/pandora_server start 
-/etc/init.d/pandora_agent_daemon start 
- 
-</code> 
- 
-  * Start the Apache web server: 
- 
-  * Apache web サーバを起動します。 
-<code> 
-systemctl start httpd.service 
- 
-</code> 
- 
-Either: 
- 
-または、 
- 
-<code> 
-/etc/init.d/httpd start 
- 
-</code> 
- 
-[[ja:documentation:start|Pandora FMS ドキュメント一覧に戻る]] 
-