The error information is as follows:
[root@localhost ~]# mysql -u root -p Enter password: ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
Cause of the problem.
There are empty users in the database
Solution:
1 Disable mysql service: # service mysql stop
2 Enter the command: # mysqld_safe –user=mysql –skip-grant-tables –skip-networking &
3 Login to the database: # mysql -u root mysql
4 mysql> use mysql;
5 mysql> select user,host,password from user;
6 Delete the empty user from the above query: mysql> delete from user where user=”;
7 Quit the database: mysql> quit
8 Start mysql service: # service mysql start
9 Log back in: # service mysql start # mysql -u root -p
Similar Posts:
- mysql ERROR 1044 (42000): Access denied for user ‘
- [Solved] MYSQL ERROR 1044 (42000): Access denied for user ”@’localhost’ to database ‘mys…
- [Solved] MYSQL Install and Login Error: Access denied for user ‘ODBC’@’localhost’ (using password: NO)
- MYSQL Login Error: mysqladmin: connect to server at ‘localhost’ failed
- [Solved] MYSQL ERROR 1044 (42000): Access denied for user ”@’localhost’ to database ‘mysql’
- Linux Login MYSQL Error: ERROR 1045 (28000): Access denied for user ‘root’@’localhost’ (using password: YES)
- [Solved] Access denied for user ‘ODBC’@’localhost’ (using password: NO)
- Solve the problem of unknown column ‘password’ in ‘field list’ in MySQL
- Mysqldump backup problems got error: 1045, error 1045 (28000), got error: 1449
- ERROR 1044 (42000): Access denied for user ‘root’@’localhost’