Mysql import from 5.6 to 5.7 : Column count of mysql.user is wrong. Expected 42, found 44. The table is probably corrupted

You might receive the error Column count of mysql.user is wrong. Expected 42, found 44. The table is probably corrupted , this is probably because you import the whole database from mysql 5.6 to 5.7 . The table structure has changed , so you need to update it. You can use the command mysql_upgrade to do this work for you.

After you import the data , run this file

mysql_upgrade -uroot -p -h127.0.0.1 -P3306

 

this command will go all over your databases table and upgrade the database structure .

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.

 

Leave a Reply

Your email address will not be published. Required fields are marked *