ERROR 1045 (28000): Access denied for user ' xxx ' @ ' localhost ' (using Password:yes)

Source: Internet
Author: User

# Bug Description

This weekend, at home to learn some new technology, although the company assigned tasks are not completed ( funny funny)

I created a MySQL database and created a new user with the root user, after all, it was very dangerous to use root in the project, especially for interns like me ( funny again). Then happily gives it permission to switch users

However, unpleasant things have happened:

ERROR 1045 (28000): Access denied for user ' xxx ' @ ' localhost ' (using Password:yes)

  The wrong password?

Forget it, knock it again.

Fuck, it's still wrong.

I might have shook my hand when I set the code.

Then I'll reset the code.

Update user set Password=password (' Password ') where user= ' username ';

Then, see 0 lines are updated???

Then with a skeptical attitude of life searched for a long time, the previous page of the blog is the same, alas ~

After a disorderly operation or no X, are said to change the password, as well as rip PHP ...

# Resolution Process

  Later inadvertently into the stackoverflower, and then a look at the question, found that the situation and I met exactly the same:

# # Questions

# # Answer

The main idea is that you have a user name is empty account, MySQL will match it first, and then always prompt you password error, delete the anonymous user, and then execute the FLUSH privileges;

User= andHost='localhost';
privileges;

# Summary

Then you can enjoy the success of the landing, the beginning of glorious additions and deletions of the trip to search

    

ERROR 1045 (28000): Access denied for user ' xxx ' @ ' localhost ' (using Password:yes)

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.