Installed a navicat, and then to connect to the MySQL server, has not been connected, the first thought is a firewall problem, and then the firewall is closed,
Iptable service shut down, or not, online check the following: Mainly because the set up the bind_address=127.0.0.1
Original quote:
Problem Description:
From a Linux remote connection on another Linux MySQL, error 2003 (HY000): Can ' t connect to MySQL server on ' xxx.xxx.xxx.85 ' (111) errors. [Mysql@vvmvcs0 ~]$ mysql-hxxx.xxx.xxx.85-uroot-penter password:www.2cto.comerror 2003 (HY000): Can ' t connect to MySQL Server on ' xxx.xxx.xxx.85 ' (111) [[Email protected] ~]$
perror 111OS error code 111:connection refusedView errorcode[[email protected] ~]$ perror 111OS error code 111:connection refused problem Analysis: 1, possible network connection ask, remote ping xxx.xxx.xxx.85, can ping pass, exclude this condition [[email protected] ~]$ ping xxx.xxx.xxx.85ping xxx.xxx.xxx.85 (xxx.xxx.xxx.85) 56 (84 ) bytes of data.64 bytes from xxx.xxx.xxx.85:icmp_seq=1 ttl=63 time=0.230 ms2, troubleshooting may be due to MY.CNF or skip_networking configured on 85 bind_ Address, allow only local socket connections 2.1 set skip_networking under [mysqld], knowledge Description: This uses MySQL only through the native socket connection (socket connection is also the default way of local connection), discard the tcp/ IP monitoring www.2cto.com Of course also does not allow the local Java program to connect to MySQL (connector/j can only be connected via TCP/IP). 2.2 may have used bind_address=127.0.0.1 (or other IP, of course) [mysqld]bind_address=127.0.0.1 knowledge Note: This situation can be tcp/ IP connection by viewing the my.cnf file, the above two are not set, exclude the two cases 3, troubleshoot the DNS resolution problem, check whether set: Skip_name_resolve. This situation is certainly not possible, because I use IP, not hostname. [Mysqld]skip_name_resolve Knowledge Description: This parameter plus, does not support the host name connection mode. 4, troubleshoot the user and password problems, in fact, the user and password error, will not appear 111, so troubleshoot the user password Error 1045 (28000): Access denied for user ' root ' @ ' XXXX ' (using Password:yes) 5, troubleshoot the--port problem, it is possible that 85 of MySQL port is not the default 3306, so I connect remotely, did not specify--port, with 3306, and 85 did not listen to 3306. Ps-ef | grep mysqld sure is: 85 on the MySQLThe 3308 port is used. Final connection: plus--port=3308[[email protected] ~]$ mysql-hxxx.xxx.xxx.85-uroot-p--port=3308enter Password:welcome to the MySQL Monitor. Commands End With; Or \g. Why is there such a low-level error? Because I have been using the 85 MySQL, and each time is directly connected with Mysql-uroot, no designated--port, so I always thought this MySQL port has been the default of 3306. In fact, the root cause is: 1.MySQL local connection, if not referred to as MySQL--protocol=tcp, the connection by default is the socket connection. We all know this. 2.MySQL socket connection is based on the Sokect file, not related to--port, if it is a multi-instance, then use-s (or--socket=name) to specify which instance to connect. That's it
socket Connection has no recognition effect on--port, leading to the problem of troubleshooting this long. See below: In fact, there is only one port of 85 on the MySQL instance, but with 3306 is still connected on this instance, indicating that the socket connection method ignores the--port parameter. -bash-3.2$ Mysql-uroot--port=3308welcome to the MySQL monitor. Commands End With; or \g.mysql-uroot--port=3306welcome to the MySQL monitor. Commands End With; or \g. Explain again
Basic DetailsIt's important. Transferred from: http://blog.csdn.net/qustdjx/article/details/26937325
Go MySQL Remote connection Error 2003 (HY000): Can ' t connect to MySQL server on ' XXXXX ' (111) issue