Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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.

share|improve this question

2 Answers 2

I got it!
The service psa-firewall, which is activated and configured by Plesk was running. It refused every incoming MySQL-requests.
I reconfigured it via Plesk, allowing it to let MySQL-requests to go through. I don't know, if I could also have it done in the shell, but deactivating it definitely helped, too! Yet I think, that might be kind of dangerous.
Thank you Oliver for trying to help me!

See you all then!

share|improve this answer

Mysql is listening by default only on loopback interface. So even with a user with right privilege, you will be unable to access remotely on your mysql server. Additionnaly, the bind-address option in not dedicated to give access on some host, but to specify the interface to listen.

So first check your mysql is listening on loopback interface

netstat -tnl | grep 3306

You will see something like that

tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN

If right, you have to change mysql configuration file

sudo nano /etc/mysql/my.cnf

Then search for the line :

bind-address = 127.0.0.1

Then replace 127.0.0.1 to 0.0.0.0. You will obtain the line :

bind-address = 0.0.0.0

Restart Mysql to take effect

/etc/init.d/mysql restart

End check that Mysql is listening on all interfaces

netstat -tnl | grep 3306

You should see :

tcp        0      0 0.0.0.0:3306          0.0.0.0:*               LISTEN
share|improve this answer
    
Hm ..using netstat -tnl | grep 3306 already returned tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN This might be because I commented out Bind-Address earlier, sorry I didn't mention that. I also tried netstat -ln | grep mysql Because the MySQL-documentation advised it :-P It returned: unix 2 [ ACC ] STREAM LISTENING 280092 /var/run/mysqld/mysqld.socket Does that have anything to do with my problem? –  Johannes Nielsen Dec 13 '12 at 16:32
    
intereseting: changing Bind-Address to 0.0.0.0 also leads to start:Job failed to start when I use service mysql restart –  Johannes Nielsen Dec 13 '12 at 17:14

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.