ERROR 1045 (28000): Access denied for user ''root'' @ ''localhost'' (using password: YES) practical solution, 28000 denied
There was no problem connecting to the database yesterday, but this error was reported when I connected to the database today. I also searched a lot on the Internet and found a solution to my problem. My environment isLinux
Step: Skip Password Authentication and find/etc/my in Linux. in the cnf file, find mysqld in the file and add the skip-grant-tables statement under mysqld. In this way, the password verification will be avoided, and then restart mysql,/etc/init. d/mysqld restart, change the password,
As follows,
Mysql> use mysql; mysql> update user set password = password ("your new password") where user = "root"; mysql> flush privileges; mysql> quit
Then restart MySQL. The statement is the same as above. Solve the problem. If you want to modify the user name at the same time, use the following statement,
Mysql> use mysql; mysql> update user set password = password ("your new password"), user = "(username to be modified)" where user = "root "; mysql> flush privileges; mysql> quit
Summary
The above is all about the MySQL error solution in this article. I hope it will be helpful to you. If you are interested, you can continue to refer to this site: Analysis of errors caused by mysql character set recovery database errors, analysis of different MySQL table sorting rules errors, etc. If you have any questions, you can leave a message at any time, the editor will reply to you in a timely manner.