Mysql was running well. I changed the root password once. It seems that it was not successful. At that time, I didn't care about it, and there was no problem with mysql. The next day, the error "access denied for user 'root' @ 'localhost' using password yes" was reported during startup ". There are many ways to solve the problem on the Internet. If you try a few ways, we will post the method after your practice is successful,
The following content is based on the Forum. 1. First, go to the windows command line mode. I installed mysql on drive C and switched to the mysql bin directory. The command format is as follows. C code www.2cto.com cd C: \ program files \ mysql server 5.1 \ bin 2. stop the mysql service and run the following command: C code C: \ Program Files \ MySQL Server 5.1 \ bin> mysqld -- defaults-file = "C: \ Program Files \ MySQL Server 5.1 \ my. ini "-- console -- skip-grant-tables. If the following result is displayed, the C code Version is successfully started: '5. 1.33-community-log 'socket: ''' port: 3306 MySQL Community Server (GPL) 3. open a dos window and switch to the C code C: \ Program Files \ MySQL Server 5.1 \ bin> mysql-uroot mysql under the bin directory. The result is as follows: C code Welcome to the MySQL monitor. commands end with; or \ g. your MySQL connection id is 2 Server version: 5.1.33-community-log MySQL Community Server (GPL) Type 'help; 'or' \ H' for help. type '\ C' to clear the buffer.
4. follow these steps and enter the C code www.2cto.com #/etc/init. d/mysql stop # mysqld_safe -- user = mysql -- skip-grant-tables -- skip-networking & # mysql-u root mysql> UPDATE user SET Password = PASSWORD ('newpassword ') where USER = 'root'; mysql> flush privileges; mysql> quit #/etc/init. d/mysql restart # mysql-uroot-p Enter password: <Enter the new password newpassword> mysql> so far, the password is successfully updated. Author dsea