Operating system: DEBIAN Linux 3.1
MySQL database version: 5.0.27
(1) Login with system root Authority
(2) Stop MySQL server:
Mysql.server stop
(3) Skip authorization form to execute MySQL server:
Mysqld_safe--skip-grant-tables--skip-networking &
(Note: Parameter--skip-grant-tables is skipped authorization table;--skip-networking is not listening for TCP/IP connections)
(4) Execute MySQL client:
Mysql
(5) Use MySQL database
Use MySQL;
(6) Update the root password
Update user set Password=password (' New password ') where user= ' root ';
(7) Shut down the MySQL server and try to start with the normal side
If you are not using this version of me, you can find a suitable version of Mysqld_safe in the MySQL installation directory, followed by--skip-grant-tables to skip the authorization form, the Mysqld_safe version of my book is "Safe_ Mysqld "(actually write here I seem to think up, where I have seen said 5.0 after the sqfe_mysqld changed into a mysqld_safe, which I found on the internet for half a day)