设置mysql允许外部连接访问

错误信息: SQL Error (1130): Host ‘192.168.1.88’ is not allowed to connect to this MySQL server 
说明所连接的用户帐号没有远程连接的权限,只能在本机(localhost)登录。

需更改 mysql 数据库里的 user表里的 host项 
把localhost改称% 
登录mysql服务器,执行以下命令 

mysql>use mysql;
mysql>update user set host = '%' where user='root';
mysql>flush privileges;
mysql>quit

备注:云服务器设置远程访问别忘了开放3306端口,否则连接不上。

转载链接:

https://blog.csdn.net/runner1920/article/details/79495595

原文地址:https://www.cnblogs.com/poterliu/p/9455734.html