zl程序教程

您现在的位置是:首页 >  数据库

当前栏目

【MySql 】is not allowed to connect to this MySql server 无法访问远程MySQL数据库

mysqlserver数据库 远程 to not is this
2023-09-11 14:22:25 时间

问题:访问远程MySQL数据库时报错【is not allowed to connect to this MySql server 】不允许访问,因为MySQL默认只有本机localhost能够访问MySQL Server服务。

开放MySQL服务给其他主机访问

在Navicat中查看当前数据库User用户表,可见默认的用户都是localhost,即只允许本机访问。

现在想要开放给其他主机访问,如果一个一个添加用户并设置权限的话太麻烦,最简单的办法是把localhost改为通配符%,然后重启服务即可。