外网连接时提示 :xxx ip is not allowed to connect to this MySQL server。
原因是 mysql数据库默认只允许自身所在的本机器连接,不允许其他机器远程访问。
解决方案:
首先进入bin目录,登录mysql。
切换到mysql数据库:use mysql;
查询有host: select host from user where user=‘root’;
更改host为所有:update user set host = ‘%’ where user =‘root’;
刷新:flush privileges;
这样就大功告成了!