程序员

MySQL无法远程访问

2022-08-10  本文已影响0人  Lyudmilalala

需要查看你希望用来远程访问的用户账号的权限

> 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;
上一篇 下一篇

猜你喜欢

热点阅读