MySql forget the root password handling

Forget your root password, you can like this  :

To windows as an example:   

1. Turn off the MySQL service is running.  

2. Open a DOS window, go to the mysql \ bin directory.  

3. Enter mysqld --skip-grant-tables carriage. --skip-grant-tables means that the time to start MySQL service permission to skip the authentication table.  

4. to open a DOS window (DOS window because that just can not move), go to the mysql \ bin directory.  

5. Enter the mysql enter, if successful, will appear MySQL prompt>.  

6. Connect authority database : use mysql;.  

6. Change Password: update user set password = password ( "123") where user = "root"; (Remember last semicolon).  

7. refresh permission (must step): flush privileges;.  

8. Quit quit.  

9. log off the system, re-entry, using the username root and the password just set up 123 new login.

Published 23 original articles · won praise 7 · views 20000 +

Guess you like

Origin blog.csdn.net/ghd602338792/article/details/86575026