MySQL - 5.5.20 アップデート時エラー!

Updated:


ローカルテスト用にと Windows マシンに MySQL をインストールしているのですが、ふとエラーログを見てみると ERROR が出力されていました。

以下、現象と対処の記録です。

記録

前提

以下の環境で確認しています。(Linux 等でも同様と思われる)

  • OS : Windows XP SP3
  • MySQL : 5.5.20

現象

MySQL のエラーログに以下のようなエラーメッセージが出力される。 ※Windows のシステムログにも同様のメッセージが出力されている。 しかし、以下のようなエラーが出力されていても MySQL は問題なく機能しているように見える。

120201 22:39:35 InnoDB: 1.1.8 started; log sequence number 10920470799
120201 22:39:35 [ERROR] Missing system table mysql.proxies_priv; please run mysql_upgrade to create it
120201 22:39:35 [ERROR] Native table 'performance_schema'.'events_waits_current' has the wrong structure
120201 22:39:35 [ERROR] Native table 'performance_schema'.'events_waits_history' has the wrong structure
120201 22:39:35 [ERROR] Native table 'performance_schema'.'events_waits_history_long' has the wrong structure
120201 22:39:35 [ERROR] Native table 'performance_schema'.'setup_consumers' has the wrong structure
120201 22:39:35 [ERROR] Native table 'performance_schema'.'setup_instruments' has the wrong structure
120201 22:39:35 [ERROR] Native table 'performance_schema'.'setup_timers' has the wrong structure
120201 22:39:35 [ERROR] Native table 'performance_schema'.'performance_timers' has the wrong structure
120201 22:39:35 [ERROR] Native table 'performance_schema'.'threads' has the wrong structure
120201 22:39:35 [ERROR] Native table 'performance_schema'.'events_waits_summary_by_thread_by_event_name' has the wrong structure
120201 22:39:35 [ERROR] Native table 'performance_schema'.'events_waits_summary_by_instance' has the wrong structure
120201 22:39:35 [ERROR] Native table 'performance_schema'.'events_waits_summary_global_by_event_name' has the wrong structure
120201 22:39:35 [ERROR] Native table 'performance_schema'.'file_summary_by_event_name' has the wrong structure
120201 22:39:35 [ERROR] Native table 'performance_schema'.'file_summary_by_instance' has the wrong structure
120201 22:39:35 [ERROR] Native table 'performance_schema'.'mutex_instances' has the wrong structure
120201 22:39:35 [ERROR] Native table 'performance_schema'.'rwlock_instances' has the wrong structure
120201 22:39:35 [ERROR] Native table 'performance_schema'.'cond_instances' has the wrong structure
120201 22:39:35 [ERROR] Native table 'performance_schema'.'file_instances' has the wrong structure
120201 22:39:35 [Note] Event Scheduler: Loaded 0 events
120201 22:39:35 [Note] MySQL: ready for connections.
Version: '5.5.20-log'  socket: ''  port: 3306  MySQL Community Server (GPL)

ちなみに、当方は Linux サーバも運用していますが、そちらの MySQL は 5.1 系のままだったので問題ありませんでした。

原因

エラーログに出力されているように、mysql.proxies_priv がおかしいようです。 要は、wrong structure (誤った構造)のテーブルがあると言っています。

そして、このエラーが出力されるようになったのは、MySQL を ‘5.5.0-m2-community’ から ‘5.5.20’ にアップデートしてからでした。

色々調べてみると、MySQL を 5.1 から 5.5 にアップグレードした時にこのようなエラーが出力されるような記事を見かけました。 今回の場合、同じ 5.5 系ですがこのような状態になりました。 ※’5.5.0-m2-community’ はインストーラでインストールしていたが、’5.5.20’ はアーカイブを展開して使用している、という違いも関係しているのかもしれません

対処

エラーログに出力されているように、mysql_upgrade を実行して MySQL を再起動すれば良いようです。 今回は Windows 環境なので、コマンドプロンプトから以下のように実行します。

C:\mysql\bin>mysql_upgrade -u root -p
Enter password: ***************
Looking for 'mysql.exe' as: C:\mysql\bin\mysql.exe
Looking for 'mysqlcheck.exe' as: C:\mysql\bin\mysqlcheck.exe
Running 'mysqlcheck' with connection arguments: "--port=3306"
Running 'mysqlcheck' with connection arguments: "--port=3306"

====< 途中省略 >====

Running 'mysql_fix_privilege_tables'...
OK

これで、エラーメッセージは出力されなくなりました。


以上。





 

Sponsored Link

 

Comments