1.当已root权限登录(mysql&Terminal)已将所有host加上密码**********************mysql>GRANTALLPRIVILEGESON*.*TO'root'@'localhost'IDENTIFIEDBY'zaq12wsx'WITHGRANTOPTION;ERROR1...
1.当已root权限登录( mysql & Terminal ) 已将所有host加上密码
**********************
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY 'zaq12wsx' WITH GRANT OPTION;
ERROR 1045 (28000): Access denied for user ''@'localhost' (using password: YES)
**********************
2.在safe模式下已将所有host加上密码然后取消localhost上的密码
**********************
mysql> UPDATE user SET Password=PASSWORD('') where host='localhost';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.00 sec)
***************************
3.restart mysql
[root@oc5550608888 ~]# mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
***************
非常奇怪,现在需要 GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY 'zaq12wsx' WITH GRANT OPTION; 来允许所有网络的连接,但是无论如何都会提示ERROR 1045 (28000): Access denied for user 'xx'@'localhost' (using password: YES)
REDHAT 9
已root方式登录无法看到mysql 这个database.
求帮助谢谢
展开