October 28, 2021

#1805 – column count of mysql.user is wrong. expected 45, found 48. the table is probably corrupted

After Searching a lot i got the solution of this error.

After Searching a lot i got the solution of this error.

This method works on mysql 5.7 and above version source stackoverflow.

The Steps are as follows:-

Step 1. Stop mysql-server:

systemctl stop mysqld

Step 2. Ater that set mysql-environment:

systemctl set-environment MYSQLD_OPTS=”–skip-grant-tables”

Step 3. Start the mysql-server using the following command:

systemctl start mysqld

Step 4. Login to mysql-server as root user:

mysql -u root

Step 5. Update the mysql-server root password using the command:

mysql> UPDATE mysql.user SET authentication_string = PASSWORD(‘YourPassword’) Where User =’root’ AND Host = ‘localhost’;

mysql> FLUSH PRIVILEGES;

mysql> quit

Step 6. Stop mysql -server

systemctl stop mysqld

Step 7. Unset the mySQL envitroment option so it starts normally next time systemctl unset-environment MYSQLD_OPTS

Step 8. Start mysql-server:

systemctl start mysqld

After that try to login using your new password

mysql -u root -p

Done Enojoy!!!

Vedant Singh

Linux System Administrator | Entrepreneur | Founder Techmion. I have started my career as a Linux system Administrator after that quit my job to start something new that excites me and started a Tech Company in order to provide the best technology to my clients. My Company website link: https://www.techmion.com/ For Bulk, SMS-Marketing follows the link : https://www.pingsms.in/

View all posts by Vedant Singh →

Leave a Reply

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

close

Ad Blocker Detected!

VEDANT EXPLAINS
We've noticed that you are using an ad blocker. Advertising helps fund our server cost and keep it truly independent. It helps to build our content creator team. So please disable your ad blocker, and help us to keep providing you with free- great content - for free. Thank you for your support.

Refresh