When I tried to connect the remote MySQL server by using command line mysql -h <remote-ip> -u any_existing_users -p or any other mysql client such as phpmyadmin, it didn't work and the error hint was

ERROR 2003 (HY000) Can't connect to MySQL server on '<remote-ip>' (61)

But, when I tried ssh <remote-ip> and connected the MySQL locally by mysql -u root -p, there is no problem.

Here is part of the user table(SELECT User, Host FROM mysql.user;):

| User             | Host           |
| root             | %              |
| other_users      | <remote-ip>    |
| root             | localhost      |

So, what's the problem?


Have you enable networking in your mysql server, please verify once more if not below are the steps by which you can do it

  Edit /etc/my.cnf, run:
  # vi /etc/my.cnf

  Once file opened, locate line that read as follows

  Make sure line skip-networking is commented (or remove line) and add following line

  • 1
    also check your IPtables should not be blocking mysql connection remotely. – Abhishek Anand Amralkar Apr 23 '13 at 5:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.