【mysql】用navicat连接虚拟机mysql出现错误代码(10038)


来源:

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;

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM