November 21, 2024

#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 Kumar

Currently I'm working as an Implementation Engineer, Started my career as an System Administrator - Linux. Additionally loves to explore new technologies and research about new open-source software that ease the development cycle.

View all posts by Vedant Kumar →

Leave a Reply

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


The reCAPTCHA verification period has expired. Please reload the page.

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