6

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?

Sterling Diaz
  • 3,789
  • 2
  • 31
  • 35

11 Answers11

4

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.

Sathish D
  • 4,854
  • 31
  • 44
2

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

Mithun Debnath
  • 588
  • 1
  • 8
  • 23
0

normally means that there is no MySQL server running on the system . check your server running

Akhil das
  • 69
  • 7
0

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

service iptables stop

user1397770
  • 135
  • 3
  • 16
0

i have the same issue but i fix it. my hostname is DEBIAN, i just modify the file my.cnf ( for mysql) and set bindaddress : 0.0.0.0

this option say to mysql to listen all interfaces. restart your server and finish

0

The SQL Sever might not be installed. Please refer this to install: MySQL

Marcus Cantu
  • 463
  • 3
  • 14
shreesh katti
  • 759
  • 1
  • 9
  • 23
0

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.

Eric Aya
  • 69,473
  • 35
  • 181
  • 253
0

Going to services and starting MYSQL service doesn't work for me. Finally, I hit the following commands inside the MYSQL command-line client: ALTER USER 'username'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';

Sundar Gautam
  • 445
  • 1
  • 6
  • 10
0

There is a high chance that you are making one of the two mistakes. First : You are inputting the wrong password. check your password or change it with this command ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'very_strong_password'; In place of 'very_strong_password' give a strong password of your choice. Second: You are using '@' in the password which can be confused with the other with @localhost.

Saman Salehi
  • 1,004
  • 1
  • 12
  • 19
ja7m
  • 1
0

The solution worked for me Go to services and start MySql services window: press the start button and search services. Then star MySql services enter image description here

Zia Khan
  • 188
  • 2
  • 9
0

In my case main application installer will install mysql and try to connect with odbc. In that time it throws above error. The password given for configuring mysql was wrong. So I changed it.

Login as user root with blank password in mysql client.

mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'abc';

Password changed and same password I used for configuration.

user16217248
  • 3,119
  • 19
  • 19
  • 37
Anonymous
  • 1
  • 3