Regaining Access to Lost MySQL Password for PHPMyAdmin on WAMP
You're facing a challenge accessing PHPMyAdmin after changing the password for the 'root'@'localhost' account. Despite using methods mentioned elsewhere, you've lost the new password and are unable to use the MySQL Console.
Solution:
To regain access, follow these steps:
1. Stop MySQL Service:
2. Edit my.ini File:
3. Restart MySQL Service:
4. Open MySQL Console:
5. Reset Root Password:
Enter the following commands at the mysql> prompt:
Pre MySQL version 5.7:
Post MySQL version 5.7:
Note: Replace 'MyNewPass' with the new password you want to set.
6. Exit MySQL Console
7. Stop MySQL Service:
8. Remove skip-grant-tables Parameter:
9. Restart MySQL Service:
10. (Optional) Prevent Password Expiration:
Enter the following command:
11. Log in to PHPMyAdmin
Remember, leaving the "skip-grant-tables" parameter in the my.ini file is a security risk. Remove it immediately after resetting the password.
The above is the detailed content of How to Recover Lost MySQL Password for PHPMyAdmin on WAMP?. For more information, please follow other related articles on the PHP Chinese website!