mysql默认只允许本地连接,生产库这样设置挺安全的。但是在开发环境,就希望其他ip也可以连接。那么如何来配置呢?
现象
其他机器连接会报错如下:
[HY000][1130] null, message from server: "Host '192.168.31.201' is not allowed to connect to this MySQL server"
解决办法
grant all privileges on *.* to 'root'@'%' identified by 'password' with grant option;
flush privileges;
查询用户
use mysql;
select user,host from user;