This article will introduce how to change the default Blank Password of mysql in WAMP and try again to log on to phpmyadmin. I hope this method will be helpful to all the users.
After WAMP is installed, the mysql password is empty. How can I modify it? In fact, it is very simple. Just run a few commands. Next I will perform the operations step by step.
First, open the mysql console through WAMP.
Prompt to enter the password. Because it is empty, press Enter.
Then enter"Use mysql", Which means to use the mysql Database and prompt" Database changed.
Then enter the SQL statement"Update user set password = PASSWORD ('hooray') where user = 'root ';", Note that the semicolon at the end of the SQL statement should not be less, and the prompt is OK. (The password set here isHooray)
Enter"Flush privileges;", If you do not enter this, the password change operation will not take effect.
Then enter"Quit.
Now that the password has been added to MYSQL, access phpmyadmin through wampserver will find that it is inaccessible and has no permission. You need to enter the password. During this time, you need to change the config In the wamp installation directory. inc. PHP file!
Open the config. inc. php file and find the following location:
The Code is as follows: |
Copy code |
$ Cfg ['servers'] [$ I] ['user'] = 'root '; $ Cfg ['servers'] [$ I] ['Password'] = ''; |
Write the previously set password next to the password, and then you can log on to phpmyadmin!