[TriLUG] what could block port=3306?

Tom Roche Tom_Roche at pobox.com
Sat Jan 19 14:34:59 EST 2008


Re: [TriLUG] what could block port=3306?

Tom Roche Jan 19, 2008 6:28 AM
 >> From either inside or outside the private network, I can do

 >> $ ssh user at lane
 >> ...
 >> user at lane:~$ telnet server 3306
 >> Trying server...
 >> Connected to server.
 >> ...

 >> but when I

 >> $ ssh user at server
 >> ...
 >> user at server:~$ telnet lane 3306
 >> Trying lane...
 >> telnet: Unable to connect to remote host: Connection refused
...
 >> How to fix? or what else to check?

Alan Porter Sat, 19 Jan 2008 10:19:42 -0500
 > Make sure someone is actually LISTENING on port 3306.

 > $ netstat -plnt

 > You should see one line like this:
 > tcp   0   0  127.0.0.1:3306   0.0.0.0:*   LISTEN   5002/mysqld

user at server:~$ date ; sudo netstat -plnt
Sat Jan 19 12:14:34 EST 2008
Password:
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address      Foreign Address State 
PID/Program name
tcp        0      0 192.168.1.102:3306 0.0.0.0:*       LISTEN 
3760/mysqld
tcp6       0      0 :::80              :::*            LISTEN 
4899/apache2
tcp6       0      0 :::22              :::*            LISTEN 3849/sshd

user at lane:~$ date ; sudo netstat -plnt
Sat Jan 19 12:18:29 EST 2008
Password:
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address      Foreign Address State 
PID/Program name
tcp        0      0 127.0.0.1:3306     0.0.0.0:*       LISTEN 
3881/mysqld
tcp6       0      0 :::80              :::*            LISTEN 
4630/apache2
tcp6       0      0 :::22              :::*            LISTEN 3961/sshd 


 > In my case, mysqld is only listening on the 'lo' interface.

As it the lane! but

 >> * both {server,lane}:/etc/mysql/my.cnf have

 >>  > # Instead of skip-networking the default is now to listen only
 >>  > # on localhost which is more compatible and is not less secure.
 >>  > bind-address            = <local IP#/>

 >>   i.e. the IP# set in the box's /etc/network/interfaces

So what am I doing wrong on lane?

 > Make sure that mysql is not using UNIX sockets (which use
 > a file handle instead of an IP address).

What sets that? startup option? or something in /etc/mysql/my.cnf?
FWIW my.cnf seem identical in that respect

user at server:~$ date ; fgrep -ie 'socket' /etc/mysql/my.cnf
Sat Jan 19 14:28:56 EST 2008
# Remember to edit /etc/mysql/debian.cnf when changing the socket location.
socket          = /var/run/mysqld/mysqld.sock
socket          = /var/run/mysqld/mysqld.sock
socket          = /var/run/mysqld/mysqld.sock

user at lane:~$ date ; fgrep -ie 'socket' /etc/mysql/my.cnf
Sat Jan 19 14:30:17 EST 2008
# Remember to edit /etc/mysql/debian.cnf when changing the socket location.
socket          = /var/run/mysqld/mysqld.sock
socket          = /var/run/mysqld/mysqld.sock
socket          = /var/run/mysqld/mysqld.sock

Thanks! Tom Roche <Tom_Roche at pobox.com>




More information about the TriLUG mailing list