Reset MySQL root passwordThis is taken from various places, in particular here. This approach worked for me under Windows XP, using MySQL 5.1. I had already added the exectuables path to the DOS path using
path=%path%;"C:\Program Files\MySQL\MySQL Server 5.1\bin".
- Turn off the MySQL service, if it's already running, using the Control Panel -> Administrative Tools (Systeembeheer) -> Services.
- In a command line window, type mysqld --skip-grant-tables. Leave it hanging. I take it this opens a MySQL daemon that lets you enter as root without a password.
- In a second command line window enter mysql -u root mysql. Now it lets you in.
- In the MySQL prompt, run these following two commands:
UPDATE user SET password=PASSWORD("topsecret") WHERE user="root";
- Quit MySQL and close the first command line window. Now you should be able to access MySQL as root using topsecret as the password after mysql -u root -p.