How to reset MySQL password in Windows
1. Open the my.ini from c:\Program Files\MySQL\my.ini with notepad.
2. Add skip-grant-tables to the under the [mysqld] section
3. Save the file and restart the MySQL service. This has disabled the grant
tables so you should be able to log into mysql without any password.
4. To reset mysql password, run command prompt.
5. Log into MySQL with the MySQL command-line utility from c:\Program Files\MySQL\bin.
No user or password parameters are required since grant tables have been
6.Execute the following statement:
UPDATE mysql.user SET PASSWORD = PASSWORD('MyPassword') WHERE user = ‘root’
Here are the result of example to set root as password.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 11
Server version: 5.5.8 MySQL Community Server (GPL)
Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
Type 'help;' or '\h' for help. Type '\c' to clear the current input
mysql> mysql -u root
-> UPDATE user SET Password = PASSWORD('root') WHERE User = 'root'
7. Remove “skip-grant-tables’ from the my.ini file and restart the MySQL
Post your questions, comments, feedbacks and suggestions
Contact a consultant