Home  >  Article  >  Backend Development  >  Solution to modify mysql access password under wamp_PHP tutorial

Solution to modify mysql access password under wamp_PHP tutorial

WBOY
WBOYOriginal
2016-07-21 15:10:431049browse

Learning PHP, using the wamp installation package to build a php+apache+mysql environment, wamp official download address: http://www.wampserver.com/en/ . But the default user of wamp The name is 'root' and the password is empty. Now I need to change the password to the string I want. The installation directory of my wamp is "d:wamp".

I searched online and tried many times, but some of them didn’t work. For example, directly modify the "D:wampappsphpmyadmin3.4.10.1config.inc.php" file and change

Copy the code The code is as follows:

$cfg['Servers'][$i]['password'] = '';

Modify Change your own password:
Copy code The code is as follows:

$cfg['Servers'][$i][' password'] = 'your password';

The username remains unchanged and is still 'root'. Then restart wamp, but the result is not working.

You should log in to the mysql client first. Since the initial password is empty, press Enter directly to enter the mysql client. Enter the sql command: UPDATE user SET Password=PASSWORD('your password') where USER='root'; It is worth noting that don’t forget the semicolon at the end of the sql command, otherwise the sql statement will not take effect. There are blog posts on the Internet saying that you also need to enter "flush priviliges", otherwise the password cannot be saved, but I can do it without going through this step. My wamp version is 2.2. Next, as mentioned at the beginning of the article, modify the config.inc.php file and copy the previous

code as follows:

$cfg['Servers'][$i]['password'] = '';

Change it to the password you just changed through the command line. Note that it must be the same.
Copy code The code is as follows:

$cfg['Servers'][$i]['password'] = ' your password';

The username remains unchanged and is still 'root'. Finally, just restart wamp!

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/327018.htmlTechArticleLearning php, using the wamp installation package to build a php+apache+mysql environment, wamp official download address: http ://www.wampserver.com/en/ .But the default username of wamp is 'root' and the password is empty. ...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn