In the course of MySQL use, we may encounter "Access denied for user ' root ' @ ' localhost ' (using password:yes)" problem, then we will solve it.
After my Baidu query finally concluded: There are two possible errors, one is the root of the MySQL user password error, and the second is insufficient authority problem. The usual solution is to change the password ...
Because I am using a Windows system, the method is also a modified method for Windows systems:
1, start → search bar input cmd→ Right Cmd.exe choose to run as administrator (you can also find this cmd.exe in the C:\Windows\System32 directory, right-click, run as Administrator)
2. Input net stop MySQL stop MySQL service
3, enter the command line to the MySQL bin directory, enter the following bold command
d:\mysql\bin>mysqld--defaults-file= "d:\mysql\my.ini"--console--skip-grant-tables
Wait a minute, show the following results illustrate MySQL boot:
22:26:09 [Warning] The syntax '--log ' is deprecated and'll be removed Inmysql 7.0. Please use '--general_log '/'--general_log_file ' instead.
22:26:09 [Warning] The syntax '--log_slow_queries ' is deprecated and'll be removed in MySQL 7.0. Please use '--slow_query_log '/'--slow_query_log_file ' instead.
22:26:09 [Warning] The syntax '--log ' is deprecated and'll be removed in MySQL 7.0. Please use '--general_log '/'--general_log_file ' instead.
22:26:09 [Warning] The syntax '--log_slow_queries ' is deprecated and'll be removed in MySQL 7.0. Please use '--slow_query_log '/'--slow_query_log_file ' instead.
22:26:09 [ERROR] The update log is no longer supported by MySQL in version 5.0 and above. It is replaced by the binary log. Now starting MySQL with--log-bin= ' instead.
22:26:09 innodb:started; Log sequence number 0 324221
22:26:09 [Note] mysqld:ready for connections. Version: ' 5.1.33-community-log ' socket: ' port:3306 MySQL Community Server (GPL)
4, and then as an administrator to open a Cmd.exe, enter the command line to the MySQL bin directory, enter:mysql-uroot mysql
5. After entering MySQL, enter the command line to change the password:
mysql>Update user set Authentication_string=password (' 123456 ') where user= ' root ';
6, Refresh permissions:mysql>flush privileges;
7, quit MySQL:mysql> quit;
8. Close mysql:d:\mysql\bin>mysqladmin shutdown (Error: Mysqladmin-uroot-p shutdown and enter new password)
9, at this point to modify the password to complete, you can enter the command line:net start mysql start MySQL service,mysql-uroot-p , enter the password can enter MySQL.
Access denied for user ' root ' @ ' localhost ' (using password:yes) workaround