ERROR 1805 (HY000): Column count of mysql.user is wrong. Table is probably corrupted

On the nixcp.com server the other day I found something weird when I was about to grant MySQL privileges to a new MySQL user. When I ran the SQL query, an error appeared on the screen:

ERROR 1805 (HY000): Column count of mysql.user is wrong. Expected 43, found 42. The table is probably corrupted

 

This was the exact output:

[[email protected]:~]mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 37
Server version: 5.6.36 MySQL Community Server (GPL)

Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> GRANT ALL PRIVILEGES ON database_wordpress.* TO 'user2'@'localhost' IDENTIFIED BY 'XXX';
ERROR 1805 (HY000): Column count of mysql.user is wrong. Expected 43, found 42. The table is probably corrupted
mysql> quit
Bye
[[email protected]:~]

How can I fix this MYSQL ERROR 1805 (HY000) Column count of mysql.user is wrong?

ERROR 1805 (HY000): Column count of mysql.user is wrong. Table is probably corrupted error can be fixed by running a simple mysql_upgrade command.
mysql_upgrade tool is used often to check for mysql table incompatibilities (crashed or corrupted tables) running on the current MySQL version. It can also be used to upgrade mysql tables if needed. In this case, we will use it to fix any corrupted tables.

Run this command as you see below:

mysql_upgrade -u root -p

Also, restart the mysql service by running:

service mysqld restart

That’s all, now your Column count of mysql.user is wrong error should be fixed.

Do you know other ways to fix this MySQL corrupted table issue? Please share your knowledge with us.

Further reading:

About the Author: Santiago Borges

Experienced Sr. Linux SysAdmin and Web Technologist, passionate about building tools, automating processes, fixing server issues, troubleshooting, securing and optimizing high traffic websites.

Leave a Reply

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