Coupon code copied
Server Intellect
(855) 850-HOST

Toll Free 24/7/365        (4678)

Get help from a Microsoft Certified Engineer.

Intellect Connect

Technical problem with your Windows Hosting?

Let our Microsoft Certified experts handle the problem for you.
Chat Now

How to Reset the MySQL Root Password

Method 1 (skip grant tables)

Open up Services (Start > Administrative Tools > Services) and completely stop the MySQL server

Open up Command Prompt and navigate to the MySQL folder. Depending on the version of MySQL, it will be in one of two locations:

  • Older versions: C:\mysql
  • Newer versions: C:\Program Files\MySQL\MySQL Server X.X
  • x86 servers: C:\Program Files (x86)\MySQL\MySQL Server X.X

Navigate into the bin folder of the MySQL directory.

Execute the following command:

mysqld.exe –u root –skip-grant-tables

Now enter the command mysql

Type use mysql to switch over to the mysql database.

Execute the following command to change the password:

UPDATE user SET Password = PASSWORD(‘NEW_PASSWORD’) WHERE User=’root’;

At this point you can type in Exit to logout of MySQL.

Go back to Services and start MySQL server.

Method 2 (init file)

Login to the server with MySQL using an account with Administrative privileges.

Open up Services (Start > Administrative Tools > Services) and completely stop the MySQL server

Open up NotePad on the server and create a text file with the following:

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

Save the file to an easy to remember location (such as the C:\) and name it mysql-init.txt

Open Command Prompt and start MySQL with the following command (change the path of mysqld to the actual location on the server):

C:\mysql\bin\mysqld –init-file=C:\\mysql-init.txt

If MySQL was installed using the installation wizard, use the following command:

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

Once the server successfully restarts, delete the mysql-init.txt file for security purposes (as it contains the new root password).

Stop MySQL server (from Services) and then start it again, this time from Services to place it back into normal operating mode.

Interested in letting our experts solve your IT problems for you?
Get a free, no-obligations consultation with one of our experts today!

Call us at (855) 850-HOST

Chat Now

Start Your Order

X

This form does not accept free e-mail accounts. Please enter a business e-mail to submit it.

Submit Form Cancel

Please wait...

Submitting your info. This may take less than a minute.