Bug #15262 Pleas add some notes about hosts.allow to section [MySQL Server has gone away]
Submitted: 26 Nov 2005 15:23 Modified: 28 Nov 2005 9:57
Reporter: Gleb Paharenko Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Server Severity:S4 (Feature request)
Version:all OS:Any (all)
Assigned to: CPU Architecture:Any

[26 Nov 2005 15:23] Gleb Paharenko
Description:
I was trying to connect to remote MySQL server, until I remember about /etc/hosts.allow file :)
I haven't found any entry about this file and TCP wrappers in:
  http://dev.mysql.com/doc/refman/5.0/en/can-not-connect-to-server.html
  http://dev.mysql.com/doc/refman/5.0/en/gone-away.html
  

How to repeat:
[gleb@blend mysql-debug-4.0.26-pc-linux-gnu-i686-glibc23]$ telnet gw.matrix.kiev.ua 3306
Trying 213.159.235.42...
Connected to gw.matrix.kiev.ua.
Escape character is '^]'.
Connection closed by foreign host.
[gleb@blend mysql-debug-4.0.26-pc-linux-gnu-i686-glibc23]$ mysql -hgw.matrix.kiev.ua
ERROR 2013 (HY000): Lost connection to MySQL server during query

Host gw.matrix.kiev.ua don't have entry for blend.ensita.net in it's hosts.allow file

Suggested fix:
Put it please in the manual. In my opinion it is quite frequent problem.
[26 Nov 2005 17:19] Valeriy Kravchuk
Sorry, but I do not think that MySQL Manual is a proper place to write about network adimistration basics, TCP/IP, SSH, TCP Wrappers and other similar (although, useful) things that may help you to connect to server or prevent the connection. It is about MySQL software and only MySQL software.
[26 Nov 2005 17:50] Sergei Golubchik
Gleb, you should specify what mysqld binary you're trying to connect to. The version, did you compiled it yourself and so on.

MySQL *can* be compiled with tcp-wrappers, but it's not done by default. Not in the mysql-debug-4.0.26-pc-linux-gnu-i686-glibc23 in any case (though it doesn't mean anything because you're connecting from the computer where this MySQL version is installed to some different computer).
[26 Nov 2005 18:03] Gleb Paharenko
Hello.

I'm sorry I haven't provided full information. MySQL version:
/usr/local/libexec/mysqld  Ver 4.0.18 for portbld-freebsd4.10 on i386 (FreeBSD port: mysql-server-4.0.18_1). I know it is very old, but wrappers support can be compiled
even with fresh version as I know. And TCP wrappers was the cause that mysql command line client was saying 'Lost connection to the server...'. In my opinion TCP wrappers related to MySQL as well as buggy switches and hubs, typing mistakes, which are ment in the documentation about different errors. However,  I'm not insisting that I'm right :)
[28 Nov 2005 9:57] Sergei Golubchik
Ok, so it's FreeBSD, and MySQL was built from ports.
MySQL port in FreeBSD is built with libwrap support, see
/usr/ports/databases/mysql40-server/Makefile
There's hardly anything we can do about it.