MySQL prompts access denied for user & #39;& #39;@& #39;localhost& #39; " The solution

Source: Internet
Author: User

Remember that because there is no network, the Rootpassword changed the wrong to write:
Update user set password= "122" where user= "root";
After that, MySQL started to work.


#mysql-U root-p
#123
will appear: Error 1045 (28000): Access denied for user ' @ ' localhost ' (using Password:no)
It can only do this:
#mysql-U Root
mysql> use MySQL
There's another error 1045 (28000): Access denied for user ' @ ' localhost ' (using Password:no)
Find a long time information:
Workaround:

1. Turn off MySQL
# Service Mysqld Stop
2. Blocking permissions
# Mysqld_safe--skip-grant-table
Screen appears: Starting demo from .....
3. Start a new terminal input
# mysql-u Root MySQL
mysql> UPDATE user SET Password=password (' NewPassword ') where user= ' root ';
Mysql> FLUSH privileges;//Remember to make this remark, otherwise assume to close the previous terminal. And it's going to be the same mistake.
Mysql> \q
That's good.

MySQL prompts access denied for user & #39;& #39;@& #39;localhost& #39; " The solution

Related Article

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.