This weekend, at home to learn some new technology, although the company assigned tasks are not completed ( funny funny )
I first created a MySQL database.
Then create a new user with the root user, after all, it is very dangerous to use root in the project, especially for interns like me ( funny again )
Then happily gives it permission and then switches the user
Then again, the unpleasant thing 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 ...
Later inadvertently into the stackoverflower, and then a look at the question, found that the situation and I met exactly the same:
And then the answer is:
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;
Can be a happy landing success, the beginning of glorious additions and deletions of the trip to search
ERROR 1045 (28000): Access denied for user ' xxx ' @ ' localhost ' (using Password:yes) "Wonderful Bug"