You are not logged in.

#1 2009-09-18 12:31:10

nilsms
Member
Registered: 2009-09-18
Posts: 4

mysql 5.1.38: rejects network connections

Hi, I installed mysql version 5.1.38 using pacman and activated networking (removed skip networking from /etc/my.cnf). When i tryed "telnet 127.0.0.1 3306" it gave an error saying that the connection was closed by the remote host. This differs from the "connection refused" message given by telnet when the mysql server is down, so the mysql server appears to be listening on port 3306.

After downloading mysql 5.1.38 from mysql.com and installing it in /usr/local/mysql. I changes the /etc/rc.d/mysqld so that it points to the new installation in /usr/local/mysql and started mysql using the rc.d script. This new isntallation used the same my.cnf and database directory as the mysql install from pacman. I tried telnet again, and this time it worked: "Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
4
5.1.38#BcL4[OV"BeVafYl5`d
"
Any sugestions out there? Did i do something wrong with my pacman install or is there a problem with 5.1.38 package?

Offline

#2 2009-09-18 15:41:45

byte
Member
From: Düsseldorf (DE)
Registered: 2006-05-01
Posts: 2,046

Re: mysql 5.1.38: rejects network connections

First of all: you never compile/install software when there's a native Arch package available.
For the connection problem: Make sure tcp_wrappers is configured correctly, see /etc/hosts.deny.

Last edited by byte (2009-09-18 15:42:31)


1000

Offline

#3 2009-09-20 10:51:18

nilsms
Member
Registered: 2009-09-18
Posts: 4

Re: mysql 5.1.38: rejects network connections

I only installed mysql manually as a part of the debuging process.
Seems to be somthing going on  with the hosts.allow file:

I had:
3306: 10.0.0.0/255.255.255.0

with that line in the allow file i was unable to connect to the Arch-mysql from localhost and from other cumputers in the 10.0.0.X network. When starting the mysql downloaded directly from mysql.com i was able to connect from localhost and other computers on the LAN.

After changing the hosts.allow entry to the following:
mysqld: 10.0.0.0/255.255.255.0
Both the Arch-mysql and the one directly from mysql.com accepts connections from other computers on the network, but only the directly downloaded one accepts connections to 127.0.0.1/localhost. I can connect to Arch-mysql from localhost using mysql -h 10.0.0.3 but mysql -h 127.0.0.1 fails.



The hosts.deny looks like this:
#
# /etc/hosts.deny
#

ALL: ALL: DENY

# End of file

Offline

#4 2009-09-20 14:23:02

neddie_seagoon
Member
Registered: 2009-08-23
Posts: 121

Re: mysql 5.1.38: rejects network connections

Do a 'netstat -an | grep 3306' and see which IP mysql has bound itself to - you may need to specify in my.cnf to bind to 0.0.0.0 (all IPs).

Offline

#5 2009-09-26 08:37:13

nilsms
Member
Registered: 2009-09-18
Posts: 4

Re: mysql 5.1.38: rejects network connections

it's bound to 0.0.0.0, so it should work:

~]$ netstat -an|grep 3306
tcp        0      0 0.0.0.0:3306            0.0.0.0:*               LISTEN
~]$ mysql -h 127.0.0.1
ERROR 2013 (HY000): Lost connection to MySQL server at 'reading initial communication packet', system error: 0

If i change the path to mysqld_safe in /etc/rc.d/mysqld so that it points to the mysqld_safe from the binnary distribution from mysql.com it works. It stil uses the same my.cnf (/etc/my.cnf).

Offline

Board footer

Powered by FluxBB