Home >Backend Development >PHP Problem >How to change mysql password in php
How to change the mysql password in php: 1. Open the wamp environment and select the myql console; 2. Select the database; 3. Pass "update user set password=password() where user = 'root'; "Just change the password.
#The operating environment of this article: Windows7 system, PHP7.1, Dell G3 computer.
How to change mysql password in php? How to change the password in the mysql console in php
When setting up the php environment, it is often encountered that the database link password cannot be set to empty. In addition to turning on the option of setting the database link password to empty, it can also be controlled in Mysql Desk, quickly set the default password, here is a quick demonstration in the wamp environment
Method:
Open the wamp environment, select the myql console
Enter the console, press Enter directly if you don’t have a password (I had a password here before)
After logging in to the Mysql console, select the database
use mysql;
Select the database named Mysql
After the database selection is successful, start to modify the password of the root user
update user set password=password('你设置的密码') where user = 'root';
Press Enter to execute the statement, After successful execution, use flush privileges to refresh
The new password will take effect
Recommended study: "PHP Video Tutorial》
The above is the detailed content of How to change mysql password in php. For more information, please follow other related articles on the PHP Chinese website!