来源:
http://www.cnblogs.com/ohmydenzi/p/5521121.html
http://blog.csdn.net/chana1101/article/details/39641415
错误信息: 2003-Can't connect to MySQL server on 'xxxxx'(10038)
1.在windows下,cmd 输入
telnet 192.168.xx.xxx 3306
其中ip是虚拟机的ip.如果连接失败
2.在虚拟机下输入
netstat -anp| grep 3306
看结果,如果结果中3306前面的ip不是0.0.0.0
3.修改/etc/mysql/mysql.conf.d/mysqld.cnf
把 bind-address = 127.0.0.1 改为 bind-address = 0.0.0.0
上面的意思是改为监听所有地址
4.对于普通用户,添加权限
mysql>grant all privileges on *.* to 'root'@'%' identified by 'youpassword' with grant option; mysql>flush privileges;