liunx下刷新mysql权限连接

解决问题:java.sql.SQLException: null,  message from server: "Host '0.0.0.0' is not allowed to connect to this MySQL server"

1.在服务器开启的情况下,进入mysql数据库命令: mysql -u root -p

2.使用mysql库命令:use mysql;

3.查看用户表 命令:SELECT `Host`,`User` FROM user;

4.更新用户列表UPDATE user SET `Host` = '%' WHERE User = 'root' LIMIT 1;

5.强制刷新权限命令:flush privileges;

猜你喜欢

转载自www.cnblogs.com/aizj/p/8940135.html