环境:centos7下
mysql版本:5.6
在使用create , grant等命令时出现了以下问题:
Column count of mysql.user is wrong. Expected 43,found 42.Created with MySQL 50552, now running 50636. Please use mysql_upgrade to fx this erior.
出现该问题的原因是在更新mysql版本后出现了新旧版本不匹配的问题!
解决方法:退出mysql-->在linux终端下输入命令: 【mysql_upgrade -u root -p你的密码】[root@bogon ~]# mysql upgrade -u root -p
Looking for 'mysql' as: mysql
Looking for 'mysqlcheck' as: mysqlcheck
Running 'mysqlcheck with default connection arguments
Warning: Using a password on the command line interface can be insecure.Running 'mysqlcheck with default connection arguments
Warning: Using a password on the command line interface can be insecure.
mysql.columns_priv OK
mysql.db OK
mysql.event OKmysql.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.proxies_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'...
Warning: Using a password on the command line interface can be insecure.
Running 'mysqlcheck with default connection arguments
Warning: Using a password on the command line interface can be insecure.
Running 'mysqlcheck with default connection arguments
Warning: Using a password on the command line interface can be insecure.
test.stu OK
OK
更新成功!!! ! !
然后再次登录你的mysql就可以了。