1.修改mysql配置文件 vim /etc/my.cnf 2.在mysqld下添加以下代码 bind-address=0.0.0.0 //或者你的ip 3.重启mysql服务 systemctl restart mysqld