- 备份
cp /etc/mysql/my.cnf /etc/mysql/my.cnf.bak
- 修改
vim /etc/mysql/my.cnf
在[mysqld]下修改为bind-address=0.0.0.0
没有的话就直接加上
[mysqld]
bind-address = 0.0.0.0
- 重启
service mysql restart
cp /etc/mysql/my.cnf /etc/mysql/my.cnf.bak
vim /etc/mysql/my.cnf
[mysqld]
bind-address = 0.0.0.0
service mysql restart