Home >Database >Mysql Tutorial >Where to change mysql database password
How to modify the password of mysql database: first open the "Task Manager" and end the mysqld process task; then open the "command prompt" and enter "cd mysql installation directory\bin"; finally modify the password field" authentication_string" can be used.
## Recommended: "mysql video tutorial"
##Modify mysql database password
Prerequisite: Operate on the computer where the mysql database service is located;
Operation:1.
Open [Task Manager] and end mysqld Process task;
#2.
Find the mysql installation location;
## 3. Find my.ini in the mysql installation directory and open it in Notepad mode File, add skip-grant-tables, under [mysqld] The purpose is to skip database permission authentication;
##4. Quick Key win R, open [Run]; # #5. Enter services.msc in [Run], open [Service], and start mysqlServe; 6. Enter cmd in [Run] to open the [Command Prompt];
##7. Enter cd mysqlInstallation directory\bin;
8. Enter mysql, to enter the database view;
9. EnterS##h## ow databases;,CheckView all databases; ##10. Enteruse mysql;,entermysqlDatabase; ## 11. Enters##how tables;, View all tables in mysql database; ##12. Enters##elect host,user,authentication_string from user; , mysql5.7 The field where the password is stored in the version database is authentication_string; 13. Enterupdate user set authentication_string=password(' root') where user='root'## and host='localhost';, Modify the login password of this machine root here to root; (If you want to modify other computers to connect to the database at the same time The password of the service does not require the judgment condition host='localhost')
14. Enterf##lush privileges;,Refresh permissions; 15. EnterQuit;, Exit the database view; 16. Delete or comment the skip permission statement added in step threeskip -grant-tables; Restartmysqlservice; 18. In the command prompt, navigate to the database installation location \bin and enter mysql -uroot -proot, can be logged in normally and the modification is successful.
The above is the detailed content of Where to change mysql database password. For more information, please follow other related articles on the PHP Chinese website!