3 August 2007

MySQL v3.23.52 on Red Hat 8.0

Had to set up an ancient MySQL database. Doncha just love legacy apps? So re-created the db server on Red Hat 8.0, installed the mysql-server rpms. Tested accessing it via localhost without any problems. Loaded in the data from the existing server (on its last legs) via this command:

@threelegs# mysqldump -h legless-server --add-drop-table --all-databases | mysql

Tested that the data was OK via localhost again. The ancient mysql-server v3.23.52 was running fine. Then I tried to access it via another client, and found this problem:

@client# mysql -h three-legs
ERROR 2013: Lost connection to MySQL server during query

Checked the log of three-legs (/usr/libexec/mysqld), and found that the server kept dying:

/usr/libexec/mysqld: ready for connections
Number of processes running now: 1
mysqld process hanging, pid 2762 - killed

Accessing from a more modern client (my ubuntu with mysql client v5.0), I got a more descriptive but just as useless error:

@clientv5.0# mysql -h three-legs
ERROR 2013 (HY000): Lost connection to MySQL server at 'reading initial communication packet', system error: 0

I googled high and low to find a solution for this problem, and was frustrated because google pageranks newer "solutions". So I had to go through many MySQL v5.0 and v4.0 issues before I found this gem. Im hoping that linking to the real solution would help increase its pagerank!

So it seems that glibc has some problems. The work-around is to put this in the /etc/my.cfg file under [mysqld]:

set-variable=thread_stack=1M

Restart the server, and it surprisingly worked! Well this problem haunted MySQL users until v4.0.9. This is why I hate messing about with ancient legacy systems.


yk.