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

How to change the database root password in phpmyadmin

王林
Release: 2019-12-28 10:09:35
Original
5136 people have browsed it

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'
Copy after login

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!

source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template