Reset Forgotten MySQL Root Password

Stop Mysql and execute the below command:

Command# mysqld_safe –skip-grant-tables &

It will start mysql in safe mode and you can execute mysql command without password

to change password execute below command in mysql shell

mysql# UPDATE mysql.user SET Password=PASSWORD(‘MyNewPass’) WHERE User=’root’;

mysql# FLUSH PRIVILEGES;

After completion of above process you need to restart the mysql and execute mysql command with new password

 

 

 

Comments are closed.