Error No. 2003. Can't connect to mysql server

2019-07-03 11:26发布

I has had two days searching and exploring solutions regarding the error 2003. Can't connect to mysql server on 'Server name'.

The firewall is off and I had added the port 3306, the one that mysql uses.

Any recommendation?

8条回答
ら.Afraid
2楼-- · 2019-07-03 11:37

Please refer this FAQ which describes how to solve this issue: http://faq.webyog.com/content/23/15/en/error-no-2003-can_t-connect.html

Error No. 2003: Can't connect to MySQL server on 'localhost' (or some other host)

simply means that connection is not possible for one of the following (or similar) reasons:

  • There is no MySQL server running at the specified host

  • Connection to the MySQL server is not allowed using TCP-IP. Check the 'skip-networking' setting in the MySQL configuration file (my.ini on Windows, my.cnf on Unix/Linux). It shall be commented out like '#skip-networking'. If it is not commented out, then do it and restart the MySQL server for the change to take effect. SQLyog needs to connect using TCP-IP.

  • Some networking issue prevents connection. It could be a network malconfiguration or a firewall issue.

  • When trying to connect to a MySQL server at an ISP this error message often indicates that direct connection to MySQL has been blocked. You must then use HTTP-tunneling or SSH-tunneling to connect.

查看更多
做自己的国王
3楼-- · 2019-07-03 11:38

if your question refer to can't connect to mysql on hosting (cpanel), i also had same problem. I also turn off firewall, but it doesn't solve my problem. Rather than using server name or domain name on Mysql Host Address, i using ip address given by hosting provider. And it works.

查看更多
Deceive 欺骗
4楼-- · 2019-07-03 11:41

this could be due to firewalls of the system try below command and check

service iptables stop

查看更多
Fickle 薄情
5楼-- · 2019-07-03 11:42

The SQL Sever might not be installed. Please refer this to install: [MySQL][1]https://dev.mysql.com/downloads/installer/

查看更多
疯言疯语
6楼-- · 2019-07-03 11:46

Unless you are using other system

Please follow theses instructions

try to use wampserver to test your code

查看更多
爷、活的狠高调
7楼-- · 2019-07-03 11:53

It worked for me.controll pannel->administrative tools->services->mysql and start mysql.Some times simple solution saves lot of time.

查看更多
登录 后发表回答