需要查看你希望用来远程访问的用户账号的权限
> use mysql;
> select user,host from user;
+-------------------------+-----------+
| user | host |
+-------------------------+-----------+
| mysql.infoschema | localhost |
| mysql.session | localhost |
| mysql.sys | localhost |
| root | localhost |
+-------------------------+-----------+
如果host为localhost
则只能在本地访问,这时候需要修改权限为%
> update user set host = '%' where user = 'root';
> flush privileges;
网友评论