I have spent many hours reading and trying dozens of variations of ways to reset the root password, but I am not getting anywhere. The most complete set of instructions I found (and tried) were the following. BTW, I am running MySQL 5.5 on Win7, 32 bit.
- I created a file, c:\mysqlinit.txt, containing the two lines: UPDATE mysql.user SET Password=PASSWORD('myroot') WHERE User='root'; flush privileges;
- Stopped the MySQL55 Service from Control Panel, Admin Tools, Services
- Opened a Command prompt window (running as the admin)
- Navigated to \Program Files\MySQL\MySQL Server 5.5\bin\
- Executed the command start mysqld --init-file=C:\mysqlinit.txt
Everything seemed to work fine (no errors). At the completion of this procedure, I thought I could log on with the root user name and the above password, but when I executed the command
mysql -u root
I received the error message,
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
I am probably doing something wrong, but can't spot it and it is driving me nuts.