Wamp to modify the MySQL root user login password

Source: Internet
Author: User
Tags mysql command line mysql database mysql login phpmyadmin

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

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

3, input "use MySQL;" Then enter, meaning to choose the MySQL database;

4, input "Update user set Password=password (' Here is the password, such as: Root ') where user= ' root ';" Then enter the return message:

Query OK, 0 rows Affected (0.00 sec)

Rows matched:2 changed:0 warnings:0

5, Input quit exit the console;

6, restart the MySQL service;

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

This MySQL login and password is no problem, but the use of phpMyAdmin login, the reminder password is invalid, because we still have a step this completes

This is only to modify the MySQL password, if access to phpMyAdmin, will prompt you permission issues and so on. 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 in the command mode, here 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

  code is as follows &nbs P;

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

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.