Set the password for MySQL in Wamp (default is empty)

Source: Internet
Author: User
Tags phpmyadmin

Set the password for MySQL in Wamp

Wamp after the installation, MySQL password is empty, then how to modify it? Actually very simple, through a few instructions on the line, below I step by step to operate.

1. First, open the MySQL console via Wamp.

Prompt for password, because it is now empty, so press ENTER directly.

2. Then enter "use MySQL", meaning "database changed" is used to indicate MySQL.

3. Then enter the SQL statement for the password you want to modify "update user set Password=password (' New password ') where user= ' root ';", note that the semicolon at the end of the SQL statement must not be small, prompting what is OK on the line.

4. Finally enter "flush privileges;", do not enter this, the operation of the password change will not be effective. Enter "Quit" to exit. Settings for the phpMyAdmin

After modifying the password for MySQL, the phpMyAdmin is also briefly configured to use phpMyAdmin to access MySQL normally. Locate the wamp\apps\phpmyadminx.x. config.inc.php file, where two lines of code are:

$cfg [' Servers '] [$i] [' user '] = ' root ';

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

The password value is empty. And then according to other commands such as above to set the MySQL initial password, only to modify the MySQL password, do not forget that the amp is three programs, so that masql to enter the password to enter, and open phpMyAdmin when the two errors appear:

"#1045 –access denied for user ' root ' @ ' localhost ' (using Password:no)" "PhpMyAdmin attempted to connect to the MySQL server, but the server refused to connect. You should check the host, user name, and password in the configuration file and confirm that the information is consistent with the information given by the MySQL server administrator. ”

Cookie is a curse because you set a cookie in the code in the config.inc.php file under wamp\apps\phpmyadminx.x.x:

$cfg [' Servers '] [$i] [' auth_type '] = ' cookie '; Workaround: Open the ie-tool-delete the cookie.

Finally restart the Wamp all server on the big announcement became!

Set the password for MySQL in Wamp (default 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.