http://www.cnblogs.com/wjoyxt/p/5477072.html
不知道是不是每次更新 MySQL 软件之后都需要执行数据库升级指令?在我进行过的几次软件升级之后,总会在 MySQL 的日志中见到
“[ERROR] Missing system table mysql.proxies_priv; please run mysql_upgrade to create it”之类的错误。虽然这个错误修复起来很简单,却不容易引起注意。
1. 错误描述
我在好几次见到这样的错误提示之后才决定好好看看到底写了些什么。因为网站运行很正常,就心想应该不怎么重要吧。错误提示大致内容如下(已将前导的日期时间略去):
[ERROR] Missing system table mysql.proxies_priv; please run mysql_upgrade to create it
[ERROR] Native table ‘performance_schema’.’events_waits_current’ has the wrong structure
[ERROR] Native table ‘performance_schema’.’events_waits_history’ has the wrong structure
[ERROR] Native table ‘performance_schema’.’events_waits_history_long’ has the wrong structure
[ERROR] Native table ‘performance_schema’.’setup_consumers’ has the wrong structure
[ERROR] Native table ‘performance_schema’.’setup_instruments’ has the wrong structure
[ERROR] Native table ‘performance_schema’.’setup_timers’ has the wrong structure
[ERROR] Native table ‘performance_schema’.’performance_timers’ has the wrong structure
[ERROR] Native table ‘performance_schema’.’threads’ has the wrong structure
[ERROR] Native table ‘performance_schema’.’events_waits_summary_by_thread_by_event_name’ has the wrong structure
[ERROR] Native table ‘performance_schema’.’events_waits_summary_by_instance’ has the wrong structure
[ERROR] Native table ‘performance_schema’.’events_waits_summary_global_by_event_name’ has the wrong structure
[ERROR] Native table ‘performance_schema’.’file_summary_by_event_name’ has the wrong structure
[ERROR] Native table ‘performance_schema’.’file_summary_by_instance’ has the wrong structure
[ERROR] Native table ‘performance_schema’.’mutex_instances’ has the wrong structure
[ERROR] Native table ‘performance_schema’.’rwlock_instances’ has the wrong structure
[ERROR] Native table ‘performance_schema’.’cond_instances’ has the wrong structure
[ERROR] Native table ‘performance_schema’.’file_instances’ has the wrong structure
[Note] Event Scheduler: Loaded 0 events
[Note] /usr/libexec/mysqld: ready for connections.
Version: ‘5.5.20-log’ socket: ‘/var/lib/mysql/mysql.sock’ port: 0
有时候可能还会多点儿如下内容:
[ERROR] Incorrect definition of table mysql.proc: expected column ‘comment’ at position 15 to have type text, found type char(64).
一般看到结尾提示个 ready for connections 一般也就没心思去看前面都提示了什么东西了。我也是有一次在 x86_64 位 CentOS 中的 MySQL 日志中见到了多出来的这个 ERROR 信息才决定好好看看的前面的错误提示的。(我是运行在 32 位 CentOS 上的。)
可是见到错误提示句子结构都差不多就没有仔细往前翻,所以我开始还重新安装了一遍 MySQL 软件包。后来才看到每次执行
service mysql restart
重起 MySQL服务的时候都会出现这样的错误提示。然后该错误提示开头还说了,让执行
mysql_upgrade
指令来修复。才恍然大悟,估计是升级了 MySQL 的软件包,管理数据库的某些表结构发生了变化,所以还需要升级数据库的相关表结构。
2. 修复
mysql_upgrade -u root -p
然后根据提示输入 mysql 的 root 帐户密码,修复过程就可自动运行。此时会有如下形式的提示信息输出:
mysql_upgrade -u root -p
Enter password:
Looking for ‘mysql’ as: mysql
Looking for ‘mysqlcheck’ as: mysqlcheck
Running ‘mysqlcheck’ with connection arguments: ‘–port=3306’ ‘–socket=/var/lib/mysql/mysql.sock’
Running ‘mysqlcheck’ with connection arguments: ‘–port=3306’ ‘–socket=/var/lib/mysql/mysql.sock’
wp_commentmeta OK
wp_comments OK
wp_links OK
wp_options OK
wp_postmeta OK
wp_posts OK
wp_term_relationships OK
wp_term_taxonomy OK
wp_terms OK
wp_usermeta OK
wp_users OK
mysql.columns_priv OK
mysql.db OK
mysql.event OK
mysql.func OK
mysql.general_log OK
mysql.help_category OK
mysql.help_keyword OK
mysql.help_relation OK
mysql.help_topic OK
mysql.host OK
mysql.ndb_binlog_index OK
mysql.plugin OK
mysql.proc OK
mysql.procs_priv OK
mysql.servers 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
Running ‘mysql_fix_privilege_tables’… OK
看来每次在 Linux 中升级了 MySQL 软件包之后都需要进行类似的数据库升级操作。
,
不知道是不是每次更新 MySQL 软件之后都需要执行数据库升级指令?在我进行过的几次软件升级之后,总会在 MySQL 的日志中见到
“[ERROR] Missing system table mysql.proxies_priv; please run mysql_upgrade to create it”之类的错误。虽然这个错误修复起来很简单,却不容易引起注意。
1. 错误描述
我在好几次见到这样的错误提示之后才决定好好看看到底写了些什么。因为网站运行很正常,就心想应该不怎么重要吧。错误提示大致内容如下(已将前导的日期时间略去):
[ERROR] Missing system table mysql.proxies_priv; please run mysql_upgrade to create it
[ERROR] Native table ‘performance_schema’.’events_waits_current’ has the wrong structure
[ERROR] Native table ‘performance_schema’.’events_waits_history’ has the wrong structure
[ERROR] Native table ‘performance_schema’.’events_waits_history_long’ has the wrong structure
[ERROR] Native table ‘performance_schema’.’setup_consumers’ has the wrong structure
[ERROR] Native table ‘performance_schema’.’setup_instruments’ has the wrong structure
[ERROR] Native table ‘performance_schema’.’setup_timers’ has the wrong structure
[ERROR] Native table ‘performance_schema’.’performance_timers’ has the wrong structure
[ERROR] Native table ‘performance_schema’.’threads’ has the wrong structure
[ERROR] Native table ‘performance_schema’.’events_waits_summary_by_thread_by_event_name’ has the wrong structure
[ERROR] Native table ‘performance_schema’.’events_waits_summary_by_instance’ has the wrong structure
[ERROR] Native table ‘performance_schema’.’events_waits_summary_global_by_event_name’ has the wrong structure
[ERROR] Native table ‘performance_schema’.’file_summary_by_event_name’ has the wrong structure
[ERROR] Native table ‘performance_schema’.’file_summary_by_instance’ has the wrong structure
[ERROR] Native table ‘performance_schema’.’mutex_instances’ has the wrong structure
[ERROR] Native table ‘performance_schema’.’rwlock_instances’ has the wrong structure
[ERROR] Native table ‘performance_schema’.’cond_instances’ has the wrong structure
[ERROR] Native table ‘performance_schema’.’file_instances’ has the wrong structure
[Note] Event Scheduler: Loaded 0 events
[Note] /usr/libexec/mysqld: ready for connections.
Version: ‘5.5.20-log’ socket: ‘/var/lib/mysql/mysql.sock’ port: 0
有时候可能还会多点儿如下内容:
[ERROR] Incorrect definition of table mysql.proc: expected column ‘comment’ at position 15 to have type text, found type char(64).
一般看到结尾提示个 ready for connections 一般也就没心思去看前面都提示了什么东西了。我也是有一次在 x86_64 位 CentOS 中的 MySQL 日志中见到了多出来的这个 ERROR 信息才决定好好看看的前面的错误提示的。(我是运行在 32 位 CentOS 上的。)
可是见到错误提示句子结构都差不多就没有仔细往前翻,所以我开始还重新安装了一遍 MySQL 软件包。后来才看到每次执行
service mysql restart
重起 MySQL服务的时候都会出现这样的错误提示。然后该错误提示开头还说了,让执行
mysql_upgrade
指令来修复。才恍然大悟,估计是升级了 MySQL 的软件包,管理数据库的某些表结构发生了变化,所以还需要升级数据库的相关表结构。
2. 修复
mysql_upgrade -u root -p
然后根据提示输入 mysql 的 root 帐户密码,修复过程就可自动运行。此时会有如下形式的提示信息输出:
mysql_upgrade -u root -p
Enter password:
Looking for ‘mysql’ as: mysql
Looking for ‘mysqlcheck’ as: mysqlcheck
Running ‘mysqlcheck’ with connection arguments: ‘–port=3306’ ‘–socket=/var/lib/mysql/mysql.sock’
Running ‘mysqlcheck’ with connection arguments: ‘–port=3306’ ‘–socket=/var/lib/mysql/mysql.sock’
wp_commentmeta OK
wp_comments OK
wp_links OK
wp_options OK
wp_postmeta OK
wp_posts OK
wp_term_relationships OK
wp_term_taxonomy OK
wp_terms OK
wp_usermeta OK
wp_users OK
mysql.columns_priv OK
mysql.db OK
mysql.event OK
mysql.func OK
mysql.general_log OK
mysql.help_category OK
mysql.help_keyword OK
mysql.help_relation OK
mysql.help_topic OK
mysql.host OK
mysql.ndb_binlog_index OK
mysql.plugin OK
mysql.proc OK
mysql.procs_priv OK
mysql.servers 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
Running ‘mysql_fix_privilege_tables’… OK
看来每次在 Linux 中升级了 MySQL 软件包之后都需要进行类似的数据库升级操作。