Master ruby with us

Reset MySQL password on Windows

Posted by firstruby on October 26, 2008

1) Log in as Administrator.

2) Stop the MySQL service. Go to Start menu > Control Panel > Administrative Tools > Services > Stop MySQL service.

3) Create “mysql-init.txt” file with following 2 lines,

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

4) Open command prompt, and give following command to reset MySQL password,

“C:\Program Files\MySQL\MySQL Server 5.0\bin\mysqld-nt” –defaults-file=”C:\Program Files\MySQL\MySQL Server 5.0\my.ini” –init-file=C:\\mysql-init.txt

The appropriate –defaults-file setting can be found using the Services Manager: From the Start menu, select Control Panel, then Administrative Tools, then Services. Find the MySQL service in the list, right-click it, and choose the Properties option. The Path to executable field contains the –defaults-file setting.

5) After the server has started successfully, delete C:\mysql-init.txt


One Response to “Reset MySQL password on Windows”

  1. Aw, this was a really nice post. Finding the time
    and actual effort to produce a top notch article… but what can I say… I procrastinate a lot and
    never seem to get nearly anything done.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: