Why does my MySQL remote-connection fail (VLAN)?

Posted by Johannes Nielsen on Ask Ubuntu See other posts from Ask Ubuntu or by Johannes Nielsen
Published on 2012-12-13T16:10:18Z Indexed on 2012/12/13 17:16 UTC
Read the original article Hit count: 514

Filed under:
|
|
|

ubuntu-community!

Again I have a problem with my special friend MySQL :D
I have got two servers - a database-server and a web-server - who are connected via VLAN.

Now I want the web-server to have remote access to the database-server's MySQL. So I created the user user in mysql.user.
user's Host is xxx.yyy.zzz.9 which is the internal IP-address of the web-server.
xxx.yyy.zzz.0 is the network. I also created user with Host % .
As long as I use MySQL on the database-server logging in as user, everything works fine. But trying to log in as user from xxx.yyy.zzz.9 using

mysql -h xxx.yyy.zzz.8 -u user -p

(where xxx.yyy.zzz.8 is the database-server's internal IP), I get

ERROR 2003 (HY000): Can't connect to MySQL server on 'xxx.yyy.zzz.8' (110)

So I tried to activate Bind-Address in the my.cnf file. Well, if I use xxx.yyy.zzz.8, nothing changes. But if I try xxx.yyy.zzz.9 and try to restart MySQL, I get

    mysql stop/waiting
    start: Job failed to start

I checked the log files and found - nothing. The database-server's MySQL doesn't even register, that the web-server tries to connect remotely.

My idea is, that maybe I didn't configure the VLAN properley, even though I asked someone who actually knows such stuff and he told me, I did everything right. What I wrote into /etc/networking/interfaces is:

    #The VLAN
    auto eth1
    iface eth1 inet static
    address xxx.yyy.zzz..8
    netmask 255.255.255.0
    network xxx.yyy.zzz.0
    broadcast xxx.yyy.zzz.255
    mtu 1500

ifconfig returns

   eth1      Link encap:Ethernet  HWaddr xxxxxxxxxxxxxx  
             inet addr:xxx.yyy.zzz.8  Bcast:xxx.yyy.zzz.255  Mask:255.255.255.0
             inet6 addr: xxxxxxxxxxxxxxx/64 Scope:Link
             UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
             RX packets:241146 errors:0 dropped:0 overruns:0 frame:0
             TX packets:9765 errors:0 dropped:0 overruns:0 carrier:0
             collisions:0 txqueuelen:1000 
             RX bytes:17825995 (17.8 MB)  TX bytes:566602 (566.6 KB)
             Memory:fb900000-fb920000 

for the eth1, what is, what I configured. (This is for the database-server, the web-server looks similar).

ethtool eth1 returns:

    Settings for eth1:

        Supported ports: [ TP ]
        Supported link modes:   10baseT/Half 10baseT/Full 
                                100baseT/Half 100baseT/Full 
                                1000baseT/Full 
        Supported pause frame use: No
        Supports auto-negotiation: Yes
        Advertised link modes:  10baseT/Half 10baseT/Full 
                                100baseT/Half 100baseT/Full 
                                1000baseT/Full 
        Advertised pause frame use: No
        Advertised auto-negotiation: Yes
        Speed: 100Mb/s
        Duplex: Full
        Port: Twisted Pair
        PHYAD: 1
        Transceiver: internal
        Auto-negotiation: on
        MDI-X: Unknown
        Supports Wake-on: d
        Wake-on: d
        Current message level: 0x00000003 (3)
                       drv probe
        Link detected: yes

(This is for the database-server, the web-server looks similar).

Actually I think, everything is right, but it still doesn't work. Is there someone with an idea?

EDIT: I commented ou Bind-Address in my.cnf after it didn't work.

© Ask Ubuntu or respective owner

Related posts about mysql

Related posts about remote-access