Learning PHP, using the Wamp installation package to build PHP + Apache + MySQL environment, Wamp official: http://www.wampserver.com/en/. But Wamp default username is 'root', the password is empty. Now I need to change the password to the desired string. The installation directory of my Wamp is "D: \ Wamp ".
I searched for it online and tried it many times, some of which were not feasible. For example, I directly modified the "D: \ Wamp \ apps \ phpmyadmin3.4.10.1 \ config. Inc. php" file
CopyCode The Code is as follows: $ cfg ['servers'] [$ I] ['Password'] = '';
Change to your own password:Copy codeThe Code is as follows: $ cfg ['servers'] [$ I] ['Password'] = 'your password ';
The username remains 'root', and then the Wamp is restarted.
Log on to the mysql client first. Because the start password is blank, press enter to enter the mysql client. Enter the SQL command: update user SET Password = PASSWORD ('your password') where user = 'root'; note that the last semicolon of the SQL command should not be forgotten, otherwise, the SQL statement does not take effect. I have a blog post on the Internet saying that I still need to enter "Flush priviliges". Otherwise, the password cannot be saved, but this step is also acceptable. My Wamp version is 2.2. NextArticleModify the config. Inc. php file
Copy code The Code is as follows: $ cfg ['servers'] [$ I] ['Password'] = '';
Change it to the password you just modified through the command line. Be sure to keep it the same.Copy codeThe Code is as follows: $ cfg ['servers'] [$ I] ['Password'] = 'your password ';
The user name remains the same. It is still 'root'. Restart Wamp!