Use phpMyAdmin to modify the root password of MySQL and how to enter the phpMyAdmin after changing the password

Source: Internet
Author: User
Tags mysql login phpmyadmin

  1. Use phpMyAdmin to modify the root password of MySQL

Many people use phpMyAdmin or the command line to modify the root password of MySQL, restart after the discovery of MySQL login error, this is why? Modify the root password of MySQL to change the root password in the MySQL database in MySQL, and to modify it in the configuration file. And the changes in the database not only modify a row of data, so do not manually modify, to use the command to modify.

First login to the phpMyAdmin with the root account, then click on the left to enter the MySQL database, click on the top of "MySQL" to enter the SQL input interface. Enter the following command: Update user set Password=password (' 123456 ') where user= ' root ' where 123456 is the password you wish to change, remember not to manually modify the password in the database. Then click "Execute" in the bottom right corner and see "Affect X line", which means the modification is successful. Then go to phpMyAdmin under the Libraries directory (the new version is this directory, it may also be in the root directory C:\wamp\apps\phpmyadmin3.5.1), modify the config.default.php file.    Find $cfg[' Servers ' [$i] [' password '] = ', modified to $cfg[' Servers ' [$i] [' password '] = ' 123456 '; 123456 is the password you want. The new password takes effect after restarting MySQL. Also modify the WWW directory under your project configuration file (C:\wamp\www\smarthome\Home\Conf) config.php, modify the following two items

' Db_user ' = ' root ',

' Db_pwd ' = ' 123456 ',

At this point, can successfully login!

2. How to enter the phpMyAdmin after changing the password

After the above modification, found that the login is not phpMyAdmin, and then open phpMyAdmin will show: "PhpMyAdmin tried to connect to the MySQL server, but the server refused to connect. You should check the host, user name, and password in the config.inc.php and make sure that the information is consistent with the information given by the administrator of the MySQL server. "It is strange that I have already filled in the password in config.inc.php's $cfg[' Servers ' [$i] [' Password '], why not? And why does phpMyAdmin not have a login interface?

Here is my answer, Wanmpserve integrated environment after installation, MySQL password is empty, this used to know, then we modify the MySQL data password to make our database more secure, very simple to find the root directory of phpMyAdmin D:\wamp\apps\ phpmyadmin3.3.9, find config.inc.php This file to open it, find this code can be modified

$cfg [' Servers '] [$i] [' auth_type '] = ' http '; (HTTP is config, the login interface will appear after HTTP is changed to phpMyAdmin)
$cfg [' Servers '] [$i] [' user '] = ' root ';
$cfg [' Servers '] [$i] [' password '] = ' your password ';

After changing the password above, I still have to change a place. That's the config.default.php file in the D:\wamp\apps\phpmyadmin3.3.9\libraries directory, find it, open it, find

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

(about 194 to 199 lines)

The login window will appear when you open your phpMyAdmin, enter root and 123456 login.

Use phpMyAdmin to modify the root password of MySQL and how to enter the phpMyAdmin after changing the password

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.