An error occurred in Suse: Access denied for user ''@ 'localhost' to &, susedenied
I haven't used MySQL for a long time. The last time I installed Banq's forum system, when MySQL Administrator is used, the system prompts mysql error number 1045 access denied for user 'admin' @ 'localhost' (using password: YES). It seems that the password is correct, the user name is wrong. I finally found that I had made the error. The user name should be root. Alas!
At the same time, I found other people's information and sent it together for the next use.
Access denied for user'' @ 'localhost' to database
I installed Mysql 10.2 With Yast2 on the built-in CD in Suse Linux 5.0. After installation, I entered mysql and mysql on the terminal.
Start successfully, exit, and enter mysqladmin-u root password XXXXX. the following error occurs: mysqladmin: connect to server at 'localhost' failed.
Error: 'Access denied for user' root' @ 'localhost' (using password: NO )'
If you enter mysql first, and then enter use mysql, the following error occurs: Access denied for user ''@ 'localhost' to database 'mysql'
Also, you can enter mysql. An error occurs when you enter mysql-u root:
Access denied for user 'root' @ 'localhost' (using password: NO ).
The reason is:
An error occurred while updating the ROOT password yesterday.
Update user set password = '000000' where user = "root" // This is an error. The password is not 123456.
Set password = password ('000000') where user = "root"
Procedure:
Close mysql:
# Service mysqld stop
Then:
# Mysqld_safe -- skip-grant-tables
Start mysql:
# Service mysqld start
Mysql-u root
Mysql> use mysql
Mysql> UPDATE user SET Password = PASSWORD ('xxx') WHERE user = 'root ';
Mysql> flush privileges;
Mysql> \ q
That's it. I hope those abve cocould do a little favor for you!