This article uses seven simple steps to set the root password of the MySQL 5.0 database.
Operating System: DEBIAN Linux
MySQL database version: 5.0.27
(1) log on with the root permission of the system;
(2) stop the MySQL server: MySQL. server stop;
(3) skip the authorization table and run the MySQL server: MySQLd_safe -- skip-grant-tables -- skip-networking &
(Note: The parameter -- skip-grant-tables indicates that the authorization table is skipped; -- skip-networking indicates that TCP/IP connections are not monitored );
(4) execute the MySQL client: MySQL;
(5) use the 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 start it with the normal side.
This document is neither original nor reposted. It is found in some books and found on the Internet. If you are not using this version, you can find a MySQLd_safe suitable for your current version in the MySQL installation directory, followed by -- skip-grant-tables to skip the authorization table.