1044 - Access denied for user ''@'localhost' to database...

创建数据库时报错:1044 - Access denied for user 'root'@'localhost' to database。。。

 

解决方法

#--------1--------------------
[root@iZbp18 ~]# mysql -u root mysql -p
Enter password: 

#--------2--------------------
mysql> delete from user where USER='';
Query OK, 0 rows affected (0.00 sec)

#--------3--------------------
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.01 sec)

mysql> \q

 

你可能感兴趣的:(mysql,sql)