MySQL 1130错误,无法远程连接

MySQL 1130错误,无法远程连接

错误:ERROR 1130: Host '192.168.1.3' is not allowed to connect to thisMySQL serve

错误1130:主机192.168.1.3”不允许连接到thismysql服务

原因:被连接的数据不允许使用 192.168.1.3访问,只允许是用 localhost;

解决办法:

可能是你的帐号不允许从远程登陆,只能在localhost。这个时候只要在localhost的那台电脑,登入mysql后,更改"mysql" 数据库里的 "user" 表里的 "host"项,从"localhost"改称"%"

 1、启用 cmd 

输入 : mysql -u -root -p 

若是提示 ‘mysql’不是内部或外部命令,也不是可运行的程序.那需要配置环境变量  在配置 path 变量添加 “……\mysq\/MYSQL Server5.7\bin”

总体运行语句:

mysql -u root -p

mysql>use mysql;

mysql>select 'host' from user where user='root';

mysql>update user set host = '%' where user ='root';

mysql>flush privileges;

mysql>select 'host'   from user where user='root';

运行完毕后再次连接测试,若还不行重启mysql服务,或是直接重启电脑

猜你喜欢

转载自blog.csdn.net/HandSome_He/article/details/82629574
今日推荐