Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The problem is that my MySQL server keeps crashing every few seconds. Even if I repeat a simple SQL command several times, the MySQL server goes down:

mysql> show databases;
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)
Can't connect to the server

Here is the error log after the crash. I have tried running myisamchk -r -f for all databases as well as mysqlcheck -aro with no luck. I have also tried upgrading my MySQL server from 5.0 to the 5.1.56 version. My my.cnf is also attached.

I have recently had problems with the hard disk and had to run fsck with the force (-f) option to be able to start my system.

Please help me to stop the server crashing. Thank you for any help.

share|improve this question
up vote 2 down vote accepted

Did you recently perform an upgrade? Did you update the privilege tables? The errors are similar to what you see during an upgrade that didn't create the privilege tables. You might want to try running the fix_privilege_tables command. This might be located at /usr/bin/mysql_fix_privilege_tables

In any-case the problem is with the privilege tables, you should probably be able to start mysql with the --skip-grant-tables option. Then restore, fix or re-create the privilege tables.

share|improve this answer
I am having the following error while running this command: ERROR 2013 (HY000) at line 388: Lost connection to MySQL server during query. I can't update the privileges table. It keeps crashing while performing this command. Same is for the --skip-grant-tables option. It keeps crashing. – Andrew Feb 11 '12 at 0:38
Ouch. Well. You could always make sure everything is stopped, move everything out of your database directory, reinstall mysql, then try restoring your databases. – Zoredache Feb 11 '12 at 1:00

Your Answer


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.