Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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)
ERROR: 
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
add comment

1 Answer 1

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
add comment

Your Answer

 
discard

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.