【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