Tips:ERROR1044(42000):Accessdenied forUser' @ ' localhost ' to database ' MySQL '. There was this problem two days ago.,Online Find a more popular method (see method I),It's done. I tried it again today.,But I can't.,On the internet for half a day,Finally found out because the MySQL databaseUserTable,An account with an empty user name is an anonymous account,Cause login is the use of root,But it's actually logged on anonymously.,You can tell by the error message "@ ' localhost.",So the solution is shown in method two.
Method One:
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> UPDATEUser set password=password (' NewPassword ') where   USER = ' root ';
mysql> FLUSH privileges;//Remember this sentence , otherwise if you close the previous terminal , will appear the original error
mysql> \q
Method Two :
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> delete From  user where  USER = ';
mysql> FLUSH privileges;//Remember this sentence , otherwise if you close the previous terminal , will appear the original error
mysql> \q
http:// cache.baiducontent.com/c?m= 9f65cb4a8c8507ed4fece7631046893b4c4380146d96864968d4e414c42246070c27e0b02d26405a94922c3a4ab21a1cacab672c601e76e0dd9bd3149 Ca6972a288c2d357708c31c528516f88b06788137902beaad1fe1adf04384aea3c4de2455ca51077897f0fa4d0167dd6f814760b2f1d809025f61ecba 6c3ea80f6029ee771df650f991752f50c1e1dd2d5bc35bc7606180a937a73e63eb4ef54c457e19e10aa6082031309158268f026013929a0bb46c2a107 0f71fa4b9b0a1eb399bdd9a74c5ba9ded&p=80798916d9c111a05bed9764164b86&newp= 8f759a46d6c005f80fbe9b7c4d5e9f231610db2151d4d0163b83c4&user=baidu&fm=sc&query=error+1044+%2842000% 29%3a+access+denied+for+user+%27%27%40%27localhost%27+to+database+%27wordpress%27&qid=f95c345800006709 &p1=1
ERROR 1044 (42000): Access denied for user "@ ' localhost ' to database ' MySQL '