#
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)