Wamp Change the login password of the MySQL root user

Source: Internet
Author: User
Tags mysql login phpmyadmin

1, after the installation of Wamp, run Wampserver program, into the MySQL console;

2, enter the console, prompt for password (do not enter any password, because the password is empty), press ENTER enter;

3. Enter "use MySQL;" Then enter, meaning to select MySQL database;

4. Enter "Update user set Password=password (' Here is the password, such as: Root ') where user= ' root '; then enter; return information:

Query OK, 0 rows Affected (0.00 sec)

Rows matched:2 changed:0 warnings:0

5, input quit quit the console;

6, restart the MySQL service;

7, enter the user name, you set the password, login success.

So MySQL login and password is no problem, but use phpMyAdmin login, reminder password is invalid, this because we have a step to complete

This only modifies the MySQL password, if you visit phpMyAdmin, you will be prompted for permissions issues. Find the phpMyAdmin installation directory, usually in wamp/apps/phpmyadmin/this location, open config.inc.php, edit the following lines:

The code is as follows
$cfg [' Servers '] [$i] [' auth_type '] = ' http ';//Modified by Config to HTTP
$cfg [' Servers '] [$i] [' user '] = ' root ';
$cfg [' Servers '] [$i] [' password '] = ' newpassword ';
$cfg [' Servers '] [$i] [' allownopassword '] = false;

All right, it's done.

Of course, we can also go through the command mode, here is a brief introduction.

Open the Wamp MySQL console so you can go to the MySQL command-line interface. Input

The code is as follows

Use MySQL;

Normal will prompt you database changed

then enter

The code is as follows

Update user set Password=password (' NewPassword ') where user= ' root ';//note the following semicolon

Wamp Change the login password of the MySQL root user

Related Article

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.