Home  >  Article  >  Database  >  How to change the database root password in phpmyadmin

How to change the database root password in phpmyadmin

王林
王林Original
2019-12-28 10:09:355091browse

How to change the database root password in phpmyadmin

First log in to phpmyadmin with the root account, then enter the mysql database, click "sql" at the top 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 want to change. Remember not to manually change the password directly in the database.

Then click "Execute" in the lower right corner. If you see "Affected x rows", it means the modification is successful.

Then you need to enter the libraries directory under the phpmyadmin directory (the new version is this directory, or it may be in the root directory C:\wamp\apps\phpmyadmin3.5.1 ), modify the config.default.php file. Find $cfg['Servers'][$i]['password'] = ' ', change it to $cfg['Servers'][$i]['password']= ' 123456'; 123456 is the password you want.

The new password will take effect after restarting mysql.

Also modify the configuration file of your project in the www directory (C:\wamp\www\smarthome\Home\Conf) config.php, and modify the following two items

'DB_USER'=>'root' 'DB_PWD'=>'123456'

Done!

Recommended related articles and tutorials: phpmyadmin tutorial

The above is the detailed content of How to change the database root password in phpmyadmin. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn