ifconfig查看虚拟机ip 主机ping 虚拟机ip需ping通 虚拟机进入mysql 给需要设置的用户授权grant all privileges on . to ‘用户名’@’%’ identified by ‘用户密码’ with grant option; 查看虚拟机mysql服务是否开启netstat -apn | grep 3306 修改mysql配置**/etc/mysql/mysql.conf.d/mysqld.cnf**注释红框内容 相关文章: