作为程序员长时间使用的测试电脑难免需要升级或者重装系统。这样问题就来了,原有的mysql数据库该如何处理呢?最近我们就遇到了类似问题。不知道是不是每次更新 MySQL 软件之后都需要执行数据库升级指令?在我进行过的几次软件升级之后,总会在 MySQL 的日志中见到“[ERROR] Missing system table mysql.proxies_priv; please run mysql_upgrade to create it”之类的错误。虽然这个错误修复起来很简单,却不容易引起注意。
查新系统日志只要是系统启动服务mysql就会出来如下信息[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
mysql_upgrade -u root -p 提示使用此命令来修复 mysql. 不过对linux系统服务器应该适用,本地这里是winxp+iis服务器,还是错误,无奈只能重装mysql来解决问题。 看来重装系统前备份mysql数据库是非常重要的事情