Host xxxxx is not allowed to connect to this MySql server
mysql拒绝远程连接
解决方法:
打开终端,进入mysql
1、先选中mysql中的 ·mysql· 表
use mysql;
2、更新权限,修改为允许全部连接
update user set host = '%' where user = 'root';
3、查看是否修改成功
select host, user from user;
4、刷新表的权限(或者重启一次mysql)
flush privileges;
以上的方法是允许所有的用户都可以连接到mysql。
如果想 指定IP地址 / 指定账户 才能连接的话,那就用到下面的方法:
1、指定账户连接(mysql默认账户名是 root):
假如:账户名是:account 密码是:accountPassword
GRANT ALL PRIVILEGES ON *.* TO 'account'@'%' IDENTIFIED BY 'accountPassword' WITH GRANT OPTION;
2、指定IP地址连接
假如本地IP地址为:192.168.3.67 使用密码:ipPassword登录
GRANT ALL PRIVILEGES ON *.* TO 'root'@'192.168.3.67' IDENTIFIED BY 'ipPassword' WITH GRANT OPTION;
以上方式执行完后,都需要刷新一次mysql的权限表,或者重启一次mysql
flush privileges;