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

I am hosting a mysql server in a debian 6.0.4 server hosted in linode, the new data is frequently written into the mysql server using R, about 30-40 "write" per minute, about 7 hours a day, 5 days a week.

Recently I found that the mysql server seem to down frequently, always give me error that mysql server cannot be connected through socket. I wonder if this is caused by my high demand to my mysql server, and if this can be solved.

I am definitely a newbie in manage server. Please let me know if I need to provide additional information for this question in order to get it solved. Thanks.

update 01

the error message is :

enter code here`ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

Then I tried the method mentioned here, then run sudo mysqld restart again, and gives me a different error message:

ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (13)
share|improve this question
30-40 writes per minute is as far from being "high demand" as my beard is from being a supernova. – Wesley Apr 9 '12 at 3:52
Also, post the exact error message that you see. – Wesley Apr 9 '12 at 3:54

The reason for your MySQL server being down will very likely be in the MySQL error log. It is located, on Debian based systems, at /var/log/mysql.log.

Edit 1

That sounds like MySQL isn't even running. See if it's running at all with ps aux | grep mysqld | grep -v grep and then see if it's listening on any network ports netstat -lntp | grep mysqld

If the log file is empty, make sure that the mysql.log is owned by the user that MySQL runs as. If it isn't, then chown it to be owned by the MySQL user. A log might also be in /var/log/mysqld/mysql.log.

share|improve this answer
I tried to view the /var/log/mysql.log, it is empty, and I just mysqld restart my server, will this be the reason that the log file is emptied? – lokheart Apr 9 '12 at 11:13
check our /var/log/syslog by default it will log there unless your my.cnf says other wise – Mike Apr 9 '12 at 11:58

try sudo apt-get remove mysql-server it will remove mysql after that install it again using sudo apt-get install mysql-server

share|improve this answer

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.