Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11
Hello, I am 5 days into trying to solve an issue I am facing connecting to MySQL from one linux box to another. I have read instructions, forum posts...the works, ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Oct 2011
    Posts
    6

    Remote MySQL Error 2003 (110) From Linux Box


    Hello,

    I am 5 days into trying to solve an issue I am facing connecting to MySQL from one linux box to another. I have read instructions, forum posts...the works, but am still unable to resolve my dilema

    When trying to make a connection to a MySQL database from linux server A to linux server B, i get the following error message:

    Error 2003 (HY000): Can't connect to MySql Server on 'IP_ADDRESS' (110).

    Firstly, I know for sure that the credentials being used for MySQL are sound. I can connect fine to the database from my home (Windows) PC. Therefore, remote connections are setup seemingly fine to MySQL on server B.

    My next train of thought is that there must be a firewall issue on server A. I am not an expert with iptables, but have attempted to open up necessary ports for MySQL (3306) in and out but the issue remains. My feeling is it must be firewall related, but I still get the issue after switching the firewall OFF on server A.

    I have also checked my.cnf file on server A and made sure there are no binding or other restrictions that would prevent the remote connection being made.

    Does anybody have any ideas what this maybe or suggest ways I may be able to narrow down where the problem is?

    Many Thanks!

  2. #2
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    Did you also set the MySQL password for the system hostname, as well as local? e.g.:
    Code:
    GRANT ALL ON dbname.* TO 'user'@'localhost' IDENTIFIED BY 'password';
    GRANT ALL ON dbname.* TO 'user'@'%' IDENTIFIED BY 'password';

  3. #3
    Just Joined!
    Join Date
    Oct 2011
    Posts
    6
    Hi Atreyu,

    Yes, wildcard access is granted to the user. I can connect from any other remote machine except the linux box.

    This therefore should rule out (i'm thinking) that the cause is with database access rights....

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Enthusiast scathefire's Avatar
    Join Date
    Jan 2010
    Location
    Western Kentucky
    Posts
    626
    Error2003-CantConnectToMySQLServer - MySQL Forge Wiki

    Seems like an extensive list to start with
    linux user # 503963

  6. #5
    Just Joined!
    Join Date
    Oct 2011
    Posts
    6
    Hi Scarthefire,

    Yes i've been through the wiki page several times and still no joy. I'm sure my issues relates to the firewall but i'm not sure how to debug further to prove. Interestingly I cannot telnet out of this linux server either to the datbase server.

    I'm thinking this must be related....again, i can telnet to the database server from my home PC.


  7. #6
    Linux Enthusiast scathefire's Avatar
    Join Date
    Jan 2010
    Location
    Western Kentucky
    Posts
    626
    Both boxes on the same LAN? If so, try turning off the firewalls on both of the boxes. If this solves the problem, then you know its a firewall issue.
    linux user # 503963

  8. #7
    Just Joined!
    Join Date
    Oct 2011
    Posts
    6

    Angry

    Quote Originally Posted by scathefire View Post
    Both boxes on the same LAN? If so, try turning off the firewalls on both of the boxes. If this solves the problem, then you know its a firewall issue.
    The boxes are not on the same LAN, but are provided by the same data provider (they are dedicated servers). I have tried switching off both firewalls but same error.

    To turn off the firewalls I did:

    service iptables stop

    I then tried to connect again, but faced the same error

  9. #8
    Linux Enthusiast scathefire's Avatar
    Join Date
    Jan 2010
    Location
    Western Kentucky
    Posts
    626
    So if Server A (the mysql server) is 192.168.a.b and Server B (other box) is 192.168.y.z and you do pings or traceroutes, what are the results? Do they succeed; if not how do they fail? Is it limited to port 3306 or any and all services (ssh, wget, etc.)
    linux user # 503963

  10. #9
    Just Joined!
    Join Date
    Oct 2011
    Posts
    6
    Quote Originally Posted by scathefire View Post
    So if Server A (the mysql server) is 192.168.a.b and Server B (other box) is 192.168.y.z and you do pings or traceroutes, what are the results? Do they succeed; if not how do they fail? Is it limited to port 3306 or any and all services (ssh, wget, etc.)
    Ok, doing a traceroute from the box to the database server returns:

    tarceroute [database_server_ip]

    traceroute to [database_server_ip], 30 hops max, 40 byte packets
    1 * * *
    2 * * *
    3 * * *
    continuest to...
    30 * * *


    ping [database_server_ip] appears to timeout. It doesn't appear to be letting the connection out.

    (By the way, i've tried this with the firewall on and off assuming service iptables stop is all that is required to turn off).

    I can traceroute the database server from outside of this box (e.g. using a tool like tools.pingdom.com/ping/), but ping always times out no matter where i try from.

    PS - thanks for your help on this!

  11. #10
    Linux Enthusiast scathefire's Avatar
    Join Date
    Jan 2010
    Location
    Western Kentucky
    Posts
    626
    Sounds to me like that machine is having routing problems. The fact that traceroute works is fine, since Linux uses UDP for traceroute purposes. Ping (ICMP) being dropped sounds like a firewall issue.

    If I were to guess just with the evidence I have, and without looking at ifconfig output, these two machines are on different networks. Its probably sending your connection out to your provider's firewall/gateway. And its most likely filtering your ping and traceroute traffic. Additionally its most likely filtering connection attempts to 3306.
    Last edited by scathefire; 10-14-2011 at 07:36 PM. Reason: trying to make it flow better
    linux user # 503963

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •