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:
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.
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:
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.
Jason Samuel is a visionary product leader and trusted advisor with a proven track record of shaping strategy and driving technology innovation. With extensive expertise in enterprise end-user computing, security, cloud, automation, and virtualization technologies, Jason has become a globally recognized authority in the IT industry. His career spans consulting for hundreds of Fortune 500 enterprises across diverse business sectors worldwide, delivering cutting-edge digital solutions from Citrix, Microsoft, VMware, Amazon, Google, and NVIDIA that seamlessly balance security with exceptional user experiences.
Jason’s leadership is amplified by his dedication to knowledge-sharing as an author, speaker, podcaster, and mentor within the global IT and technology community. Recognized with numerous prestigious awards, Jason’s contributions underscore his commitment to advancing technology and empowering organizations to achieve transformative results. Follow him on LinkedIn.
Thanks a lot for this article!
Hi Jason, I read your blogs and its quite good and eye opening for me. I need an input from…
I'm with Richard Powell and Andreas Mariotti. Things work if I do it the USB redirection way, but not with…
We see this behaviour with 2203 CU2 VDAs and while being happy, that there is at leasy an workaround without…
Saved my butt without playing around over dozens attempts to get that certificate installed! Thank you! <3 Chris