mysql 登陆异常 Host 'x.x.x.x' is not allowed to connect to this MySQL server"

mysql默认只允许通过localhost访问

可通过以下语句查询

use mysql;
select host from user where user='root';

结果:

+-----------+
| host      |
+-----------+
| localhost |
+-----------+

Host列指定了允许用户登录所使用的IP,可以使用通配符%,例如‘10.1.%’。
如果host=’%‘标识允许所有地址访问

原创文章 68 获赞 61 访问量 2916

猜你喜欢

转载自blog.csdn.net/zhoudingding/article/details/105854501