root password mysql

Mysql is an Open source database server which is widely used in today’s technology as of its stability , scalability and secure. It uses port 3306.

Check Out Solve Mysql Cant Connect To local Mysql Server Through Socket

Let’s recover the root password

First you will have to skip the table in order to recover the password and command is mysqld_safe –skip-grant-tables &

if above command gives you an error then follow steps below

Step 1 : Stop the Mysql server service

Step 2 : Now you will have to set the environment of Mysql to skip-grant-tables

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

Step 3 :  Start the Mysql Service

Now you have to update the password with below command

Login to Mysql server with mysql –u root


UPDATE mysql.user SET authentication_string = PASSWORD(‘Password’) WHERE User = ‘root’ AND Host = ‘localhost’;

Step  4: Flush Privileges and quit.

Now try to login with new password, You must be able to login

Enjoy you have successfully recover the password of Mysql Server.

You’re done



Please enter your comment!
Please enter your name here

six + 2 =