ja:documentation:pandorafms:technical_annexes:19_mysql_8

差分

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

この比較画面へのリンク

両方とも前のリビジョン 前のリビジョン
次のリビジョン
前のリビジョン
ja:documentation:pandorafms:technical_annexes:19_mysql_8 [2024/08/25 06:39] – [CentOS 7] junichija:documentation:pandorafms:technical_annexes:19_mysql_8 [2025/02/20 06:50] (現在) – [Rocky Linux 8/AlmaLinux 8/RHEL 8] junichi
行 41: 行 41:
   * データバックアップ手順を実行します。詳細は、[[:ja:documentation:07_technical_annexes:07_backup_and_restore_procedures|バックアップおよびリストア手順]] を参照してください。   * データバックアップ手順を実行します。詳細は、[[:ja:documentation:07_technical_annexes:07_backup_and_restore_procedures|バックアップおよびリストア手順]] を参照してください。
  
-===== CentOS 7 =====+<wrap #ks2 />
  
-<WRAP center round info 90%> +===== Rocky Linux 8/AlmaLinux 8/RHEL 8 =====
- +
-CentOS 7 will soon reach its end-of-life (**EOL**). //This documentation is retained for historical purposes.// +
- +
-</WRAP> +
- +
-<WRAP center round info 90%> +
- +
-CentOS 7 はサポート終了 (**EOL**) となっています。//このドキュメントは過去の情報保持の目的で置いています。// +
- +
-</WRAP>+
  
   * Stop the PFMS server and the PFMS Software Agent:   * Stop the PFMS server and the PFMS Software Agent:
  
-  * Pandora FMS サーバと Pandora FMS ソフトウエアエージェントを停止します。+  * Pandora FMS サーバおよび Pandora FMS ソフトウエアエージェントを停止します。
  
 <code bash> <code bash>
-/etc/init.d/pandora_server stop +systemctl stop pandora_server 
-/etc/init.d/pandora_agent_daemon stop+systemctl stop pandora_agent_daemon
  
 </code> </code>
行 67: 行 57:
   * Stop the Apache web server:   * Stop the Apache web server:
  
-  * Apache Web サーバを停止します。+  * Apache web サーバを停止します。
  
 <code bash> <code bash>
行 85: 行 75:
   * Make a special database backup that is compatible with MySQL 8:   * Make a special database backup that is compatible with MySQL 8:
  
-  * MySQL 8 に互換性ある特別なデータベースバックアップを作成します。+  * MySQL 8 に互換性ある特別なデータベースバックアップを作成します。
  
 <code bash> <code bash>
行 97: 行 87:
   * Make a backup as it is done in MySQL 5.7 (an additional insurance if you have to go back to this version):   * 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 での通常のバックアップを作成します。(このバージョンに戻す場合の追加の保険です)+  * MySQL 5.7 での通常のバックアップを作成します。(このバージョンに戻す場合の追加の保険です)
  
 <code bash> <code bash>
行 127: 行 117:
  
 <code bash> <code bash>
-yum install https://repo.percona.com/yum/percona-release-latest.noarch.rpm -y+dnf install https://repo.percona.com/yum/percona-release-latest.noarch.rpm -y
  
 </code> </code>
行 145: 行 135:
  
 <code bash> <code bash>
-yum install percona-server-server+dnf install percona-server-server
  
 </code> </code>
行 160: 行 150:
   * Modify the ''my.cnf''  file to dispense with ''query_cache_*'':   * Modify the ''my.cnf''  file to dispense with ''query_cache_*'':
  
-  * ''query_cache_*'' を無効化するように ''my.cnf'' ファイルを修正します。+  * ''query_cache_*'' を無効化するために ''my.cnf'' を修正します。
  
 <code bash> <code bash>
行 172: 行 162:
   * If **you do not have an HA environment**, disable the binary logs with the following command in the ''[mysqld]''  section:   * If **you do not have an HA environment**, disable the binary logs with the following command in the ''[mysqld]''  section:
  
-  * **HA 環境が無い場合**は、''[[mysqld]]'' セクションの次のコマンドでバイナリログを無効化します。+  * **HA 環境が無い場合**は、''[mysqld]'' セクションの次のコマンドでバイナリログを無効化します。
  
 <code> <code>
行 181: 行 171:
 <WRAP center round tip 90%> <WRAP center round tip 90%>
  
-See also "[[en:documentation:pandorafms:complex_environments_and_optimization:08_optimization##ks1_8_1|Optimization and troubleshooting]]" for checking the ''my.cnf'' file.+See also "[[en:documentation:pandorafms:complex_environments_and_optimization:08_optimization##ks1_8_1|Optimization and troubleshooting]]" for checking the ''my.cnf''  file.
  
 </WRAP> </WRAP>
行 220: 行 210:
 You will get an answer similar to the following: You will get an answer similar to the following:
  
-次のような出力を確認できます。+次のような出力が見られます。
  
 <code> <code>
行 254: 行 244:
 </code> </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:+  * The necessary permissions (//grants//) must be added again; //if you are not logged in// to ''mysql'' as user **root** (replace ''<\_password\_>'' with the corresponding password) run:
  
-  * 必要なアクセス許可を再度追加する必要があります。 ''mysql''//ログインしていない場合// 、 **root** ユーザ(パスワードは対応るものを利用)として以下を実行します:+  * 必要な権限 (//grants//を再度追加する必要があります。ユーザ **root** として ''mysql'' にログインしていない場合は (''<\_password\_>'' を対応するパスワードに置き換えます)、次を実行します
  
 <code bash> <code bash>
-mysql -u root -p < password >+mysql -uroot -p < password >
  
 </code> </code>
  
-  * **Once logged in as root execute the following commands:** +  * **Once logged in as root execute the following commands**: 
-  * Deactivate the password validation plugin (optional).+  * Deactivate the password validation plugin (**optional**).
  
-  * **root としてログインしら次のコマンドを実行します** +  * **root としてログインし次のコマンドを実行します**: 
-  * パスワード検証プラグインを無効にします(オプション)。+  * パスワード検証プラグインを無効にします (**オプション**)。
  
-<code>+<code sql>
 UNINSTALL COMPONENT 'file://component_validate_password'; UNINSTALL COMPONENT 'file://component_validate_password';
  
 </code> </code>
  
-  * Create the login user if it does not exist:+  * Create the login user **if it does not exist**:
  
-  * ログインユーザが存在しない場合は作成します。+  * **ログインユーザが存在しない場合は** 作成します。
  
 <code sql> <code sql>
行 285: 行 275:
 <WRAP center round tip 90%> <WRAP center round tip 90%>
  
-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.+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>
行 291: 行 281:
 <WRAP center round tip 90%> <WRAP center round tip 90%>
  
-データベースへの接続 IP アドレスを制限したい場合は、''%'' を接続元の IP アドレスに変更する必要があります。+データベースへの接続の IP アドレスを制限する場合は、''%'' を接続元の IP アドレスに変更する必要があります。
  
 </WRAP> </WRAP>
行 297: 行 287:
   * Assign the native password for ''mysql'':   * Assign the native password for ''mysql'':
  
-  * ''mysql'' ネイティブパスワードを設定します。+  * ''mysql'' ネイティブ パスワードを割り当てます。
  
 <code sql> <code sql>
行 306: 行 296:
   * Grant grants on Pandora FMS database (''pandora''):   * Grant grants on Pandora FMS database (''pandora''):
  
-  * Pandora FMS データベース(''pandora'')に対して grant 行います。+  * Pandora FMS データベース (''pandora'') に対する権限付与します。
  
-<codes sql>+<code sql>
 GRANT ALL PRIVILEGES ON pandora.* TO "<DBUSER>"@'%'; GRANT ALL PRIVILEGES ON pandora.* TO "<DBUSER>"@'%';
  
 </code> </code>
  
-  * Save the changes and exit:+  * Save changes and exit:
  
-  * 変更を保存して抜けます。+  * 変更を保存して終了します。
  
 <code sql> <code sql>
行 322: 行 312:
  
 </code> </code>
 +
 +<WRAP center round info 90%>
 +
 +To change the authentication type in MySQL 8 refer to the topic «[[:en:documentation:pandorafms:technical_annexes:46_mysql_sha|Configuring SHA authentication method in MySQL]]».
 +
 +</WRAP>
 +
 +<WRAP center round info 90%>
 +
 +MySQL 8 で認証タイプを変更するには、トピック「[[:ja:documentation:pandorafms:technical_annexes:46_mysql_sha|MySQL での SHA 認証方法の設定]]」を参照してください。
 +
 +</WRAP>
  
 Once you have finished working with the database, perform the following steps: Once you have finished working with the database, perform the following steps:
  
-データベースの対応が完了したら、次のステップを実行します。+データベース作業が完了したら、次の手順を実行します。
  
   * Start the PFMS server and the PFMS Software Agent:   * Start the PFMS server and the PFMS Software Agent:
行 332: 行 334:
  
 <code bash> <code bash>
-/etc/init.d/pandora_server start +systemctl start pandora_server 
-/etc/init.d/pandora_agent_daemon start+systemctl start pandora_agent_daemon
  
 </code> </code>
行 339: 行 341:
   * Start the Apache web server:   * Start the Apache web server:
  
-  * Apache Web サーバを起動します。+  * Apache web サーバを起動します。
  
 <code bash> <code bash>
行 346: 行 348:
 </code> </code>
  
-Either:+[[ja:documentation:start|Pandora FMS ドキュメント一覧に戻る]]
  
-または、+===== (OBSOLETE) CentOS 7 =====
  
-<code bash> +<WRAP center round info 90%>
-/etc/init.d/httpd start+
  
-</code>+CentOS 7 will soon reach its end-of-life (**EOL**). //This documentation is retained for historical purposes.//
  
-===== Rocky Linux 8/AlmaLinux 8/RHEL 8 =====+</WRAP> 
 + 
 +<WRAP center round info 90%> 
 + 
 +CentOS 7 はサポート終了 (**EOL**) となっています。//このドキュメントは過去の情報保持の目的で置いています。// 
 + 
 +</WRAP>
  
   * Stop the PFMS server and the PFMS Software Agent:   * Stop the PFMS server and the PFMS Software Agent:
  
-  * Pandora FMS サーバおよび Pandora FMS ソフトウエアエージェントを停止します。 +  * Pandora FMS サーバと Pandora FMS ソフトウエアエージェントを停止します。 
-<code>+ 
 +<code bash>
 /etc/init.d/pandora_server stop /etc/init.d/pandora_server stop
 /etc/init.d/pandora_agent_daemon stop /etc/init.d/pandora_agent_daemon stop
行 368: 行 376:
   * Stop the Apache web server:   * Stop the Apache web server:
  
-  * Apache web サーバを停止します。 +  * Apache Web サーバを停止します。 
-<code>+ 
 +<code bash>
 systemctl stop httpd.service systemctl stop httpd.service
  
行 378: 行 387:
 または、 または、
  
-<code>+<code bash>
 /etc/init.d/httpd stop /etc/init.d/httpd stop
  
行 385: 行 394:
   * Make a special database backup that is compatible with MySQL 8:   * Make a special database backup that is compatible with MySQL 8:
  
-  * MySQL 8 に互換性ある特別なデータベースバックアップを作成します。 +  * MySQL 8 に互換性ある特別なデータベースバックアップを作成します。 
-<code>+ 
 +<code bash>
 mysqldump -u root -p pandora \ mysqldump -u root -p pandora \
   --skip-add-drop-table \   --skip-add-drop-table \
行 396: 行 406:
   * Make a backup as it is done in MySQL 5.7 (an additional insurance if you have to go back to this version):   * 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 での通常のバックアップを作成します。(このバージョンに戻す場合の追加の保険です+  * MySQL 5.7 での通常のバックアップを作成します。(このバージョンに戻す場合の追加の保険です) 
-<code> + 
-mysqldump -u root -p pandora > backup_pandora_5.7.sql+<code bash
 +mysqldump -u root -p pandora> backup_pandora_5.7.sql
  
 </code> </code>
行 405: 行 416:
  
   * MySQL 設定ファイル(''my.cnf'')をバックアップします。   * MySQL 設定ファイル(''my.cnf'')をバックアップします。
-<code>+ 
 +<code bash>
 cp /etc/my.cnf /tmp/my.cnf.BACK cp /etc/my.cnf /tmp/my.cnf.BACK
  
行 413: 行 425:
  
   * Percona 5 リポジトリを削除します。   * Percona 5 リポジトリを削除します。
-<code>+ 
 +<code bash>
 rpm -qa | grep Percona-Server | xargs rpm -e --nodeps rpm -qa | grep Percona-Server | xargs rpm -e --nodeps
  
行 421: 行 434:
  
   * Percona 8 リポジトリをインストールします。   * Percona 8 リポジトリをインストールします。
-<code> 
  
-dnf install https://repo.percona.com/yum/percona-release-latest.noarch.rpm -y+<code bash> 
 +yum install https://repo.percona.com/yum/percona-release-latest.noarch.rpm -y
  
 </code> </code>
行 430: 行 443:
  
   * 前述のリポジトリを有効化します。   * 前述のリポジトリを有効化します。
-<code>+ 
 +<code bash>
 percona-release setup ps80 percona-release setup ps80
  
行 438: 行 452:
  
   * Percona 8 をインストールします。   * Percona 8 をインストールします。
-<code> + 
-dnf install percona-server-server+<code bash
 +yum install percona-server-server
  
 </code> </code>
行 446: 行 461:
  
   * ''my.cnf'' ファイルをリストアします。   * ''my.cnf'' ファイルをリストアします。
-<code>+ 
 +<code bash>
 mv /tmp/my.cnf.BACK /etc/my.cnf mv /tmp/my.cnf.BACK /etc/my.cnf
  
行 453: 行 469:
   * Modify the ''my.cnf''  file to dispense with ''query_cache_*'':   * Modify the ''my.cnf''  file to dispense with ''query_cache_*'':
  
-  * ''query_cache_*'' を無効化するために ''my.cnf'' を修正します。 +  * ''query_cache_*'' を無効化するように ''my.cnf'' ファイルを修正します。 
-<code>+ 
 +<code bash>
 sed -i -e "s/^query_cache_type.*/#query_cache_type/g" /etc/my.cnf 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_size.*/#query_cache_size/g" /etc/my.cnf
行 464: 行 481:
   * If **you do not have an HA environment**, disable the binary logs with the following command in the ''[mysqld]''  section:   * If **you do not have an HA environment**, disable the binary logs with the following command in the ''[mysqld]''  section:
  
-  * **HA 環境が無い場合**は、''[mysqld]'' セクションの次のコマンドでバイナリログを無効化します。+  * **HA 環境が無い場合**は、''[[mysqld]]'' セクションの次のコマンドでバイナリログを無効化します。
  
 <code> <code>
行 471: 行 488:
 </code> </code>
  
-<WRAP center round tip 60%>+<WRAP center round tip 90%>
  
-See also "[[:en:documentation:05_big_environments:08_optimization#check_mycnf_settings|Optimization and troubleshooting]]" for checking the ''my.cnf''  file.+See also "[[en:documentation:pandorafms:complex_environments_and_optimization:08_optimization##ks1_8_1|Optimization and troubleshooting]]" for checking the ''my.cnf'' file.
  
 </WRAP> </WRAP>
  
-<WRAP center round tip 60%>+<WRAP center round tip 90%>
  
-''my.cnf'' ファイルのチェックには、"[[:ja:documentation:05_big_environments:08_optimization#mycnf_設定の確認|最適化と問題解決]]" も参照してください。+''my.cnf'' ファイルのチェックには、"[[:ja:documentation:pandorafms:complex_environments_and_optimization:08_optimization#mycnf_設定の確認|最適化と問題解決]]" も参照してください。
  
 </WRAP> </WRAP>
行 486: 行 503:
  
   * MySQL サービスを起動します。   * MySQL サービスを起動します。
-<code>+ 
 +<code bash>
 systemctl start mysql systemctl start mysql
  
行 495: 行 513:
 または、 または、
  
-<code>+<code bash>
 service mysqld start service mysqld start
  
行 503: 行 521:
  
   * インストールされたバージョンを確認します。   * インストールされたバージョンを確認します。
-<code>+ 
 +<code bash>
 mysql --version mysql --version
  
行 510: 行 529:
 You will get an answer similar to the following: You will get an answer similar to the following:
  
-次のような出力が見られます。+次のような出力を確認できます。
  
 <code> <code>
行 530: 行 549:
       * 特別な MySQL 8 互換バックアップをインポートします。       * 特別な MySQL 8 互換バックアップをインポートします。
  
-<code>+<code bash>
 mysql -u root -p pandora mysql -u root -p pandora
  
 </code> </code>
  
-<code>+<code sql>
 drop database pandora; drop database pandora;
 create database pandora; create database pandora;
行 543: 行 562:
  
 </code> </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 bash>
 +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 sql>
 +CREATE USER "<DBUSER>"@'%' IDENTIFIED BY "<DBPASS>";
 +
 +</code>
 +
 +<WRAP center round tip 90%>
 +
 +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 90%>
 +
 +データベースへの接続 IP アドレスを制限したい場合は、''%'' を接続元の IP アドレスに変更する必要があります。
 +
 +</WRAP>
 +
 +  * Assign the native password for ''mysql'':
 +
 +  * ''mysql'' にネイティブパスワードを設定します。
 +
 +<code sql>
 +ALTER USER "<DBUSER>"@'%' IDENTIFIED WITH mysql_native_password BY "<DBPASS>";
 +
 +</code>
 +
 +  * Grant grants on Pandora FMS database (''pandora''):
 +
 +  * Pandora FMS データベース(''pandora'')に対して grant を行います。
 +
 +<codes sql>
 +GRANT ALL PRIVILEGES ON pandora.* TO "<DBUSER>"@'%';
 +
 +</code>
 +
 +  * Save the changes and exit:
 +
 +  * 変更を保存して抜けます。
 +
 +<code sql>
 +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:   * Start the PFMS server and the PFMS Software Agent:
  
   * Pandora FMS サーバおよび Pandora FMS ソフトウエアエージェントを起動します。   * Pandora FMS サーバおよび Pandora FMS ソフトウエアエージェントを起動します。
-<code>+ 
 +<code bash>
 /etc/init.d/pandora_server start /etc/init.d/pandora_server start
 /etc/init.d/pandora_agent_daemon start /etc/init.d/pandora_agent_daemon start
行 555: 行 648:
   * Start the Apache web server:   * Start the Apache web server:
  
-  * Apache web サーバを起動します。 +  * Apache Web サーバを起動します。 
-<code>+ 
 +<code bash>
 systemctl start httpd.service systemctl start httpd.service
  
行 565: 行 659:
 または、 または、
  
-<code>+<code bash>
 /etc/init.d/httpd start /etc/init.d/httpd start
  
 </code> </code>
- 
-[[ja:documentation:start|Pandora FMS ドキュメント一覧に戻る]] 
- 
  
  • ja/documentation/pandorafms/technical_annexes/19_mysql_8.1724567989.txt.gz
  • 最終更新: 2024/08/25 06:39
  • by junichi