Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

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

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

  bind-address=YOUR-SERVER-IP
share|improve this answer
1  
also check your IPtables should not be blocking mysql connection remotely. –  Abhishek Anand Amralkar Apr 23 '13 at 5:57

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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