根据错误提示error:1130 host"xxx" is not allowed to connect to this SQL server,说明host不允许连接,那么就需要去对host进行设置。
操作如下:
1.在cmd 使用mysql -u root -p #进入数据库
2.使用show databases; #查看数据库,找到mysql
3.使用use mysql; #选择操作的数据库
4.show tables; #查看表找到user表
5.desc user; #查看表的属性
6.select host,user from user where user = "root"; #查看root 对应的host
7.update user set host="%" where user = "root"; #更新root 的 host属性
8.flush privileges; #刷新数据库
参考博文:https://blog.csdn.net/weixin_44197207/article/details/86496678