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=’%‘标识允许所有地址访问

原文地址:https://www.cnblogs.com/luguojun/p/14294754.html