How to change the mysql access password under wamp _ PHP Tutorial

Source: Internet
Author: User
How to change the mysql access password under wamp. To learn about php, use the wamp installation package to build the php + apache + mysql environment. wamp official website: www. wampserver. comen. However, the default user name of wamp is root and the password is blank. 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

The code is as follows:


$ Cfg ['servers'] [$ I] ['password'] = '';


Change to your own password:

The 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. Next, modify the config. inc. php file

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.

The code is as follows:


$ Cfg ['servers'] [$ I] ['password'] = 'Your password ';


The user name remains the same. it is still 'root'. restart wamp!

Login http://www.wampserver.com/en/. but wamp default username is 'root', password is empty ....

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.