Encountering MySQL "error code #1045 access denied for user ' root ' @ ' localhost ' (using Password:yes)" requires a password to reset the root account, this is generally not very good solution.
However, these days debugging really encountered this problem, can not skip, must be resolved in the local debugging program source code, no way, a little solution.
Fortunately, the situation of this kind of problem, a lot of people, so many move off-the-shelf, as long as it can solve the problem on the line.
Method:
1th, stop the MySQL service, CMD Open the dos window, enter "net stop MySQL", but sometimes do not stop is indifferent;
2nd, in the CMD Command Line window, go to the MySQL installation directory such as "E:\APMServ5.2.6\MySQL5.1\bin" (I use Apmserver)
Such as:
3rd, in the 2nd Command window, enter the command as: "Mysqld-nt--skip-grant-tables"
The function is to enter the MySQL security mode, that is, when MySQL gets up, you can enter the database without entering a password.
This time can enter the database, to their own database reset password on it!
If you still get a 1045 error, continue with the following actions
1. Reopen a CMD command-line window, enter: "Mysql-uroot-p", use a blank password to log in to MySQL (Do not enter the password, directly press ENTER)
2. Enter the following command to start modifying the root user's password (note: there is a "dot" in the middle of the command "Mysql.user")
"Mysql>update Mysql.user set Password=password (' New password ') where user= ' root ';
3. Refresh the Permissions table
"Mysql>flush Privileges"
4. Exit: "Mysql>quit"
Get it done, retire!
Welcome reprint, Ly Inn-Kang Jianjun-blog: MySQL error code #1045 Access denied for user ' root ' @ ' localhost ', reproduced please specify the original URL: http://blog.lykezhan.com/jishu/ Biji/2017/0319/224.html
MySQL error code #1045 Access denied for user ' root ' @ ' localhost '