ERROR 3009 (HY000): Column count of mysql.user is wrong解决办法


在扩展线上MySQL_Slave后进行数据库主库授权 发现不能同步到slave,于是去slave上进行授权测试 出现如下错误:

mysql> grant select on tx.* to utx@'182.161.7.%' identified by '111111';
ERROR 3009 (HY000): Column count of mysql.user is wrong. Expected 45, found 43. Created with MySQL 50623, now running 50719. Please use mysql_upgrade to fix this error.

经检查发现是slave数据库的版本比master数据库版本略高导致的。
解决办法如下:

[root@de.mysql.slave.03 data]# mysql_upgrade -uroot -p -S /data/mysql/data/mysql.sock
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
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.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
Upgrading the sys schema.
Checking databases.
an.xx OK
......
Upgrade process completed successfully.
Checking if update is needed.

发表评论

电子邮件地址不会被公开。 必填项已用*标注