Connect with us

Hi, what are you looking for?

MySQL

How to reset the root user account for a MySQL database

Sometimes you may inherit a MySQL databse server and have no credentials to access anything.  None of the default accounts work.  Your only option is to reset the root user account password.  This is very easy to do.

1. Open up Windows Task Manager and stop the mysqld.exe (MySQL daemon) process.
2. Open up Computer Management > Services > and stop the MySQL service if it isn’t already stopped.
3. Open up a command prompt and go to your MySQL bin folder, for example:

 C:\Program Files\MySQL\MySQL Server 5.1\bin

then type in:

Advertisement. Scroll to continue reading.

 mysqld.exe –skip-grant-tables

this will restart the MySQL daemon process.

4. Now type in:

 mysql.exe -u root

and it should log you right in as the root user without having to specify a password.

Advertisement. Scroll to continue reading.

5. Now you need to reset the password.  Type:

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

You can change the password to whatever you want.  I have set it to “MyNewPassword” above.

6. Now type:

Advertisement. Scroll to continue reading.

 FLUSH PRIVILEGES;

and you’re done!  Try logging in using your new credentials and it should work just fine.  Don’t forget to verify that your MySQL service has been restarted.

Click to comment

Leave a Reply

Your email address will not be published. Required fields are marked *

You May Also Like

Apache

Today I would like to go over proper URL redirection when using SSL but first I would like to preface this by describing what...

Exchange 2003

A useful Exchange 2003 guide I wrote for a friend’s blog originally but I am posting it here on mine now for your viewing...

Citrix Workspace

You can use FIDO2 hardware security keys plugged into your physical desktop over the Citrix HDX remoting protocol for use with virtualized Windows Desktop...

Cloud Design Architecture

The community-driven paperback book initiated by my friends Bas van Kaam and Christiaan Brinkhoff is available for sale on Amazon. If you haven’t picked...

Advertisement

JasonSamuel.com was launched in 2008 as a platform to give back to the IT community by sharing knowledge and expertise. Over the years, it has become a trusted global resource for the latest insights, how-to guides, and forward-thinking leadership on enterprise mobility, security, virtualization, cloud architecture, automation, and other cutting-edge technologies. Today, it serves as a go-to reference hub for IT professionals, attracting hundreds of thousands of unique visitors from around the world each month. Learn more on the About Me page.
Copyright © 2008-2025 JasonSamuel.com