How To Solve #1045 Cannot log in to MySQL Server

Share it:

You may get this error in MySQL #1045 Cannot log in to MySQL Server

Then you have to reset your password

MYSQL Password Reset Steps

Step 1:Check service running or not,if runing then stop MySQL 

sudo  service mysql stop

Step 2:Start the mysqld demon process using skip grand tales command

sudo /usr/bin/mysqld  --skip-grant-tables --skip-networking &

Step 3: Login to mysql Client

mysql -u root 

Step 4: Issue FLUSH Privileges command

FLUSH PRIVILEGES;

Step 5:Change the password

SET PASSWORD FPR [email protected]'localhost' = PASSWORD('NEW password here');

Step 6: Start MySQL 

sudo service mysql start

Now give the Username as root and  New password in the password field
Share it:

Post A Comment: