Resetting-MySql-Password

Forgetting your MySQL password can be a real headache for you.Here are some easy steps that you can follow to recover MySql password under Windows

Stop MySql

You have to stop MySql service before you proceed.In Windows environment, go to 'Task Manager' and Under 'Service' tab find MySQL and stop it.

Write Sql to change your password

All you need to do is to create a text file and put the below two lines into that. UPDATE mysql.user SET Password=PASSWORD('MyNewPass') WHERE User='root'; FLUSH PRIVILEGES; Save it under C:\ drive and give it a name 'mysql-init.txt'

Time to restart MySQL by your own.

Now it's time to restart your MySQl which you stopped in before but this time from command line. C:\> C:\mysql\bin\mysqld-nt --init-file=C:\\mysql-init.txt

Finishing up!

Now you can log in with your new password. When you finish remove the file that you created in the previous stage.

Add Comment An email address is required to stop the spam from my little site, and will not be displayed in comments.

ss

2013-10-27 05:34:35

"ssss"