ERROR 1045 (28000): Access denied for user ''root'' @ ''localhost'' (using password: YES) practical solution, 28000 denied

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.