Column count of mysql.user is wrong. Expected 42, found 39. Created with MySQL 50173, now running 50560. Please use mysql_upgrade to fix this error.

This error occurred in my environment when i tried to create a user in MySQL, most likely you have upgraded MySQL Server (51. to 5.6  in my case) . After upgrading your MySQL you have to run  mysql_upgrade to fix any incompatibilities in System tables. If it finds any errors it automatically repairs it and upgrades all the internal data dictionary.

Just run the below command after upgrading your MySQL, restart MySQL and it will fix the issue.

# mysql_upgrade --force -u root -p
# service mysqld restart

 

Category: DatabaseLinux

Tags:

Leave a Reply

Article by: Shadab Mohammad