ホーム > Linux, mysql > yumでMySQL5.5.44からMySQL5.7にアップデートする その2

yumでMySQL5.5.44からMySQL5.7にアップデートする その2

2017 年 6 月 18 日

前回のyumでMySQL5.5.44からMySQL5.7にアップデートする その1でmysqlを5.6にバージョンアップして特にエラーログが出ていないことを確認して次は、5.7へバージョンアップしてみます。

前回同様のコマンドで実施します。また、今回もmysqlサーバも停止せずにやってみます。
(インストール後にmysqldを再起動します。)

まず、現在のバージョンの確認

[root@www16071ue mysql]# mysql --version
mysql  Ver 14.14 Distrib 5.6.36, for Linux (x86_64) using  EditLine wrapper

続いてリポジトリのmysqlのバージョン確認

[root@www16071ue mysql]# yum list --enablerepo=mysql57-community --disablerepo=updates,base,extras | grep mysql
compat-mysql51.x86_64               5.1.54-1.el6.remi         @remi
mysql-community-client.x86_64       5.6.36-2.el6              @mysql56-community
mysql-community-common.x86_64       5.6.36-2.el6              @mysql56-community
mysql-community-devel.x86_64        5.6.36-2.el6              @mysql56-community
mysql-community-libs.x86_64         5.6.36-2.el6              @mysql56-community
mysql-community-server.x86_64       5.6.36-2.el6              @mysql56-community
mysql57-community-release.noarch    el6-10                    @/mysql57-community-release-el6-10.noarch
php-mysqlnd.x86_64                  5.5.19-2.el6.remi         @remi-php55
mysql-community-client.i686         5.7.18-1.el6              mysql57-community
mysql-community-client.x86_64       5.7.18-1.el6              mysql57-community
mysql-community-common.i686         5.7.18-1.el6              mysql57-community
mysql-community-common.x86_64       5.7.18-1.el6              mysql57-community
mysql-community-devel.i686          5.7.18-1.el6              mysql57-community
mysql-community-devel.x86_64        5.7.18-1.el6              mysql57-community
mysql-community-embedded.i686       5.7.18-1.el6              mysql57-community
mysql-community-embedded.x86_64     5.7.18-1.el6              mysql57-community
mysql-community-embedded-devel.i686 5.7.18-1.el6              mysql57-community
mysql-community-embedded-devel.x86_64
                                    5.7.18-1.el6              mysql57-community
mysql-community-libs.i686           5.7.18-1.el6              mysql57-community
mysql-community-libs.x86_64         5.7.18-1.el6              mysql57-community
mysql-community-libs-compat.i686    5.7.18-1.el6              mysql57-community
mysql-community-libs-compat.x86_64  5.7.18-1.el6              mysql57-community
mysql-community-release.noarch      el6-7                     mysql57-community
mysql-community-server.x86_64       5.7.18-1.el6              mysql57-community
mysql-community-test.x86_64         5.7.18-1.el6              mysql57-community
mysql-ref-manual-5.5-en-html-chapter.noarch
                                    1-20170320                mysql57-community
mysql-ref-manual-5.5-en-pdf.noarch  1-20170320                mysql57-community
mysql-ref-manual-5.7-en-html-chapter.noarch
                                    1-20170110                mysql57-community
mysql-ref-manual-5.7-en-pdf.noarch  1-20170110                mysql57-community

今現在インストールされているphp-mysqlnd.x86_64 5.5.19-2.el6.remi @remi-php55が気になりますが
そのほかは、5.7にバージョンがあがるようですね。
早速インストールをはじめます。

[root@www16071ue mysql]# yum update mysql --enablerepo=mysql57-community --disablerepo=updates,base,extras
読み込んだプラグイン:fastestmirror, priorities, security
更新処理の設定をしています
Loading mirror speeds from cached hostfile
依存性の解決をしています
--> トランザクションの確認を実行しています。
---> Package mysql-community-client.x86_64 0:5.6.36-2.el6 will be 更新
---> Package mysql-community-client.x86_64 0:5.7.18-1.el6 will be an update
--> 依存性の処理をしています: mysql-community-libs(x86-64) >= 5.7.9 のパッケージ: mysql-community-client-5.7.18-1.el6.x86_64
--> トランザクションの確認を実行しています。
---> Package mysql-community-libs.x86_64 0:5.6.36-2.el6 will be 更新
--> 依存性の処理をしています: libmysqlclient.so.18()(64bit) のパッケージ: mysql-community-devel-5.6.36-2.el6.x86_64
---> Package mysql-community-libs.x86_64 0:5.7.18-1.el6 will be an update
--> 依存性の処理をしています: mysql-community-common(x86-64) >= 5.7.9 のパッケージ: mysql-community-libs-5.7.18-1.el6.x86_64
--> トランザクションの確認を実行しています。
---> Package mysql-community-common.x86_64 0:5.6.36-2.el6 will be 更新
--> 依存性の処理をしています: mysql-community-common(x86-64) = 5.6.36-2.el6 のパッケージ: mysql-community-server-5.6.36-2.el6.x86_64
---> Package mysql-community-common.x86_64 0:5.7.18-1.el6 will be an update
---> Package mysql-community-devel.x86_64 0:5.6.36-2.el6 will be 更新
---> Package mysql-community-devel.x86_64 0:5.7.18-1.el6 will be an update
--> トランザクションの確認を実行しています。
---> Package mysql-community-server.x86_64 0:5.6.36-2.el6 will be 更新
---> Package mysql-community-server.x86_64 0:5.7.18-1.el6 will be an update
--> 依存性解決を終了しました。

依存性を解決しました

==========================================================================================================================================
 パッケージ                              アーキテクチャ          バージョン                      リポジトリー                        容量
==========================================================================================================================================
更新:
 mysql-community-client                  x86_64                  5.7.18-1.el6                    mysql57-community                   23 M
依存性関連での更新をします。:
 mysql-community-common                  x86_64                  5.7.18-1.el6                    mysql57-community                  328 k
 mysql-community-devel                   x86_64                  5.7.18-1.el6                    mysql57-community                  3.6 M
 mysql-community-libs                    x86_64                  5.7.18-1.el6                    mysql57-community                  2.1 M
 mysql-community-server                  x86_64                  5.7.18-1.el6                    mysql57-community                  152 M

トランザクションの要約
==========================================================================================================================================
アップグレード       5 パッケージ

合計容量: 180 M
これでいいですか? [y/N]y
パッケージをダウンロードしています:
rpm_check_debug を実行しています
トランザクションのテストを実行しています
トランザクションのテストを成功しました
トランザクションを実行しています
  更新                    : mysql-community-common-5.7.18-1.el6.x86_64                                                               1/10
  更新                    : mysql-community-libs-5.7.18-1.el6.x86_64                                                                 2/10
  更新                    : mysql-community-client-5.7.18-1.el6.x86_64                                                               3/10
  更新                    : mysql-community-server-5.7.18-1.el6.x86_64                                                               4/10
warning: /etc/my.cnf created as /etc/my.cnf.rpmnew
  更新                    : mysql-community-devel-5.7.18-1.el6.x86_64                                                                5/10
  整理中                  : mysql-community-server-5.6.36-2.el6.x86_64                                                               6/10
  整理中                  : mysql-community-devel-5.6.36-2.el6.x86_64                                                                7/10
  整理中                  : mysql-community-client-5.6.36-2.el6.x86_64                                                               8/10
  整理中                  : mysql-community-libs-5.6.36-2.el6.x86_64                                                                 9/10
  整理中                  : mysql-community-common-5.6.36-2.el6.x86_64                                                              10/10
  Verifying               : mysql-community-server-5.7.18-1.el6.x86_64                                                               1/10
  Verifying               : mysql-community-common-5.7.18-1.el6.x86_64                                                               2/10
  Verifying               : mysql-community-libs-5.7.18-1.el6.x86_64                                                                 3/10
  Verifying               : mysql-community-devel-5.7.18-1.el6.x86_64                                                                4/10
  Verifying               : mysql-community-client-5.7.18-1.el6.x86_64                                                               5/10
  Verifying               : mysql-community-server-5.6.36-2.el6.x86_64                                                               6/10
  Verifying               : mysql-community-common-5.6.36-2.el6.x86_64                                                               7/10
  Verifying               : mysql-community-devel-5.6.36-2.el6.x86_64                                                                8/10
  Verifying               : mysql-community-client-5.6.36-2.el6.x86_64                                                               9/10
  Verifying               : mysql-community-libs-5.6.36-2.el6.x86_64                                                                10/10

更新:
  mysql-community-client.x86_64 0:5.7.18-1.el6

依存性を更新しました:
  mysql-community-common.x86_64 0:5.7.18-1.el6  mysql-community-devel.x86_64 0:5.7.18-1.el6  mysql-community-libs.x86_64 0:5.7.18-1.el6
  mysql-community-server.x86_64 0:5.7.18-1.el6

完了しました!

異常なくアップデート完了!!

MYSQL再起動します。

[root@www16071ue mysql]# /etc/init.d/mysqld restart
mysqld を停止中:                                           [  OK  ]
mysqld を起動中:                                           [  OK  ]

前回同様にmysqlのテーブルなどをアップグレードするためmysql_upgradeコマンドを発行
(UPGRADEする前にerror.logなどを見るとわかりますがテーブルなどの権限やテーブル名など細かいところで変更があった場合
エラーがたくさん出ています。)

2017-06-17T06:53:42.988460Z 0 [ERROR] Native table 'performance_schema'.'status_by_thread' has the wrong structure
2017-06-17T06:53:42.988529Z 0 [ERROR] Native table 'performance_schema'.'status_by_user' has the wrong structure
2017-06-17T06:53:42.988584Z 0 [ERROR] Native table 'performance_schema'.'global_status' has the wrong structure
2017-06-17T06:53:42.988641Z 0 [ERROR] Native table 'performance_schema'.'session_status' has the wrong structure
2017-06-17T06:53:42.988682Z 0 [ERROR] Native table 'performance_schema'.'variables_by_thread' has the wrong structure
2017-06-17T06:53:42.988717Z 0 [ERROR] Native table 'performance_schema'.'global_variables' has the wrong structure
2017-06-17T06:53:42.988750Z 0 [ERROR] Native table 'performance_schema'.'session_variables' has the wrong structure
2017-06-17T06:53:42.988889Z 0 [ERROR] Incorrect definition of table mysql.db: expected column 'User' at position 2 to have type char(32), found type char(16).
などなど

そんでもってupgrade

[root@www16071ue mysql]# mysql_upgrade -u root -p
Enter password:
Checking if update is needed.
Checking server version.
Running queries to upgrade MySQL server.
Checking system database.
mysql.columns_priv                                 OK
mysql.db                                           OK
mysql.engine_cost                                  OK
~中略~
error    : Table rebuild required. Please do "ALTER TABLE `wp2_blc_links` FORCE" or dump/reload to fix it!
Note     : TIME/TIMESTAMP/DATETIME columns of old format have been upgraded to the new format.
status   : OK
~中略~
Upgrade process completed successfully.
Checking if update is needed.

途中上記のerrorやNoteが出たけどどうなんでしょうか?
とりあえずUpgradeは、コンプリートして成功したとなっているので大丈夫でしょうか?

怪しいのでmysqlcheckというコマンドがあるようですのでこれを行ってみたいと思います。

upgradeの中でもやっているという記述はありますが、ものは、試しということで・・・。

4.5.3 mysqlcheck — テーブル保守プログラム

https://dev.mysql.com/doc/refman/5.6/ja/mysqlcheck.html

mysqlcheck クライアントでは、テーブルの保守 (テーブルの検査、修復、最適化、分析) を実行します。

mysqlcheck の機能は myisamchk と同様ですが、作動方法が異なります。主な作動方法の違いは、mysqlcheckmysqld サーバーが稼働中のときに使用されなければならないのに対し、myisamchk はこのサーバーが稼働していないときに使用されるべきであるという点です。mysqlcheck を使用することの利点は、テーブルの保守を行うためにサーバーを停止する必要がないことです。

ということで起動中でもできるのでやってみます

 

バージョン確認

[root@www16071ue mysql]# mysqlcheck -u root -p --check --all-databases
Enter password:
mysql.columns_priv                                 OK
mysql.db                                           OK
mysql.engine_cost                                  OK
mysql.event                                        OK
mysql.func                                         OK
mysql.general_log                                  OK
mysql.gtid_executed                                OK
mysql.help_category                                OK
mysql.help_keyword                                 OK
mysql.help_relation                                OK
mysql.help_topic                                   OK
mysql.host                                         OK
mysql.innodb_index_stats                           OK
mysql.innodb_table_stats                           OK
mysql.ndb_binlog_index                             OK
mysql.plugin                                       OK
mysql.proc                                         OK
mysql.procs_priv                                   OK
mysql.proxies_priv                                 OK
mysql.server_cost                                  OK
mysql.servers                                      OK
mysql.slave_master_info                            OK
mysql.slave_relay_log_info                         OK
mysql.slave_worker_info                            OK
mysql.slow_log                                     OK
mysql.tables_priv                                  OK
mysql.time_zone                                    OK
mysql.time_zone_leap_second                        OK
mysql.time_zone_name                               OK
mysql.time_zone_transition                         OK
mysql.time_zone_transition_type                    OK
mysql.user                                         OK
~中略~
wordpress.wp_yarpp_related_cache                   OK

問題ないようです。
これでバージョンアップ完了です。

※追記20170619
ちなみにmysqltuner.plを起動したらエラーが出てもう一度mysqldを再起動したらmysqltunerも使えるようになりました。

*****************************************************************************

ブログランキング・にほんブログ村へ
にほんブログ村

PVアクセスランキング にほんブログ村

カテゴリー: Linux, mysql タグ: ,
コメントは受け付けていません。