phpMyAdmin How to modify the MySQL root password

Source: Internet
Author: User
Tags flush phpmyadmin

First with the root account login phpMyAdmin, and then click on the left to enter the MySQL database, at the top of the click "MySQL" into the SQL input interface. Enter the following command:

The code is as follows Copy Code

Update user set Password=password (' 123456 ') where user= ' root '


Note that if you modify the root password, the password in our phpMyAdmin configuration file also needs to be modified, otherwise login does not go up oh.


phpMyAdmin modified MySQL database root password succeeded

Then you have to enter the phpMyAdmin under the Libraries directory, modify config.default.php file. Find $cfg[' Servers ' [$i] [' password '] = ',

Amended to

The code is as follows Copy Code
$cfg [' Servers '] [$i] [' password '] = ' 123456′;

123456 is the password you want.

The new password takes effect when you restart MySQL.


Other ways to modify the root password method, using the command mode

Lost root password

The code is as follows Copy Code
Mysqld_safe--skip-grant-tables&
Mysql-u Root MySQL
mysql> UPDATE user SET Password=password ("New password") WHERE user= ' root ';
mysql> FLUSH privileges;

Under normal circumstances modify

Edit the user table directly with update

  code is as follows copy code

Mysql-u Root

mysql> use MySQL;

mysql> UPDATE user SET Password = Password (' newpass ') WHERE user = ' root ';

Mysql> FLUSH privileges;

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.