MySQL5.5の起動時【Native table 'performance_schema'.'〜〜〜〜' has the wrong structure】について

前回の続きです。
設定に入る前に、MySQLエラーログを見ていたら、エラーがすごく表示されていたのでそっちから入ります。


110808 2:59:58 [Note] /usr/libexec/mysqld: Normal shutdown

110808 2:59:58 InnoDB: Starting shutdown...
110808 2:59:58 InnoDB: Shutdown completed; log sequence number 2282115
110808 2:59:58 [Note] /usr/libexec/mysqld: Shutdown complete

110808 02:59:58 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
110808 02:59:59 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
110808 2:59:59 [Warning] The syntax '--log' is deprecated and will be removed in a future release. Please use '--general-log'/'--general-log-file' instead.
110808 2:59:59 [Note] Plugin 'FEDERATED' is disabled.
/usr/libexec/mysqld: Table 'mysql.plugin' doesn't exist
110808 2:59:59 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
110808 2:59:59 InnoDB: The InnoDB memory heap is disabled
110808 2:59:59 InnoDB: Mutexes and rw_locks use InnoDB's own implementation
110808 2:59:59 InnoDB: Compressed tables use zlib 1.2.3
110808 2:59:59 InnoDB: Using Linux native AIO
110808 2:59:59 InnoDB: Initializing buffer pool, size = 128.0M
110808 2:59:59 InnoDB: Completed initialization of buffer pool
110808 2:59:59 InnoDB: highest supported file format is Barracuda.
110808 2:59:59 InnoDB: Waiting for the background threads to start
110808 3:00:00 InnoDB: 1.1.8 started; log sequence number 2282115
110808 3:00:00 [ERROR] Missing system table mysql.proxies_priv; please run mysql_upgrade to create it
110808 3:00:00 [ERROR] Can't open and lock privilege tables: Table 'mysql.servers' doesn't exist
110808 3:00:00 [ERROR] Native table 'performance_schema'.'events_waits_current' has the wrong structure
110808 3:00:00 [ERROR] Native table 'performance_schema'.'events_waits_history' has the wrong structure
110808 3:00:00 [ERROR] Native table 'performance_schema'.'events_waits_history_long' has the wrong structure
110808 3:00:00 [ERROR] Native table 'performance_schema'.'setup_consumers' has the wrong structure
110808 3:00:00 [ERROR] Native table 'performance_schema'.'setup_instruments' has the wrong structure
110808 3:00:00 [ERROR] Native table 'performance_schema'.'setup_timers' has the wrong structure
110808 3:00:00 [ERROR] Native table 'performance_schema'.'performance_timers' has the wrong structure
110808 3:00:00 [ERROR] Native table 'performance_schema'.'threads' has the wrong structure
110808 3:00:00 [ERROR] Native table 'performance_schema'.'events_waits_summary_by_thread_by_event_name' has the wrong structure
110808 3:00:00 [ERROR] Native table 'performance_schema'.'events_waits_summary_by_instance' has the wrong structure
110808 3:00:00 [ERROR] Native table 'performance_schema'.'events_waits_summary_global_by_event_name' has the wrong structure
110808 3:00:00 [ERROR] Native table 'performance_schema'.'file_summary_by_event_name' has the wrong structure
110808 3:00:00 [ERROR] Native table 'performance_schema'.'file_summary_by_instance' has the wrong structure
110808 3:00:00 [ERROR] Native table 'performance_schema'.'mutex_instances' has the wrong structure
110808 3:00:00 [ERROR] Native table 'performance_schema'.'rwlock_instances' has the wrong structure
110808 3:00:00 [ERROR] Native table 'performance_schema'.'cond_instances' has the wrong structure
110808 3:00:00 [ERROR] Native table 'performance_schema'.'file_instances' has the wrong structure
110808 3:00:00 [ERROR] Column count of mysql.db is wrong. Expected 22, found 20. Created with MySQL 50077, now running 50515. Please use mysql_upgrade to fix this error.
110808 3:00:00 [ERROR] mysql.user has no `Event_priv` column at position 29
110808 3:00:00 [ERROR] Cannot open mysql.event
110808 3:00:00 [ERROR] Event Scheduler: An error occurred when initializing system tables. Disabling the Event Scheduler.
110808 3:00:00 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.5.15-log' socket: '/var/lib/mysql/mysql.sock' port: 3306 MySQL Community Server (GPL) by Remi

エラー出てる・・・・
なんだろうとおもって調べたら、参考サイト(①)ありました。

mysql_upgrade
↓↓↓公式リファレンス引用↓↓↓
MySQL のアップグレードでは、その度に、mysql_upgrade を実行します。これにより、データベース内のテーブルにおける最新の MySQL Server との互換性をチェックすることができます。該当テーブルが非互換の場合は、チェックの対象になり、問題があれば、そのテーブルを修正します。mysql_upgrade コマンドは、システム テーブルのアップグレードも行うため、新たな権限と追加機能を使用できるようになります。
MySQLを起動したまま↑のコマンドを実行すると解決できるらしい。


が、アップグレード失敗してしまう。

Looking for 'mysql' as: mysql
Looking for 'mysqlcheck' as: mysqlcheck
Running 'mysqlcheck with default connection arguments
mysqlcheck: Got error: 1045: Access denied for user 'root'@'localhost' (using password: NO) when trying to connect
FATAL ERROR: Upgrade failed
なんでかな〜と思って調べた結果、
コマンドの使い方を間違っていたみたいです。
↓が正しいコマンドの使い方です。

mysql_upgrade -u ユーザ名 -p
Enter password:パスワード
全部のテーブルの互換性チェックしてくるのか〜。
ECCUBE2.11入れてたけどすぐおわりました〜。


MySQLを再起動してエラーログを見てみると
見事にエラーがなくなりました。
MySQLをアップグレードしたらこのコマンド打たないとだめみたいですね。
覚えておこ!
しかしコピペで終わらせようとしたせいで、失敗して遠回り・・・
ちゃんと使い方をみないとだめですね・・・
まぁ失敗するほうが自分らしくていいんですけどね。
次はこそ、my.cnfの設定をやる!


参考サイト
http://d.hatena.ne.jp/red_snow/20101227/1293419008
http://firegoby.theta.ne.jp/archives/2171
MySQL :: MySQL 5.6 リファレンスマニュアル :: 4.4.7 mysql_upgrade — MySQL テーブルのチェックとアップグレード