MySQL change root password for Windows

In a shared environment you are asked to tackle many strange tasks and not so strange tasks. Among my many common tasks that I’m asked to look into is management of MySQL on a windows platform. While there are plenty of instructions on how to manage MySQL in a linux environment there are little such documentation for a Windows platform.

I won’t go into the merits of MySQL on a Windows or Linux platform. As a system administrator you are asked to manage and fix problem not decided what is the best course of action.

To reset a root password in Windows is not really not much a difficult task so I’ll out line it here:

Problem: lost root password for MySQL windows implamentation

  1. Stop the MySQL services
  2. open a command window and use the following command: “C:\<wherever_you_installed_MySQL>\bin\mysqld-nt –skip-grant-tables”
  3. open a second command window and user the following command: “c:\mysql -u root”
  4. This will start MySQL command line interface, now type: “use mysql;”
  5.  Next type in: “update user set password=PASSWORD(“some_new_password”) where Use=’root’;”
  6. now type in: “flush privileges;”
  7. finally: “quit”

You will have to restart the Windows server, but once this is complete you would have reset the MySQL root password.

Tags :

About the Author

Leave a Reply

%d bloggers like this: