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

Whenever I try and run mysql I get the following error:

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

I did some research and it looks to be cause the file mysqld.sock doesn't exist. I did a

ps -elf | grep mysql

and could not find mysql running. I then did

service mysql start

and it just froze (never started) I eventually ^C out of it and did

service mysql status

and it said that mysql is running, but when I run

ps -elf | grep mysql

it again shows nothing. I then stop the mysql service and again it hangsup so I used ^C to stop that and when I check the status it properly shows the status as stopped. I am so awkwardly lost and don't know where to go from here. The following is the latest from my error log file:

111227 18:07:42 [ERROR] /usr/sbin/mysqld: Can't open file: './wordpress/wp_7_rg_form_view.frm' (errno: 24)
111227 21:37:43 [Note] /usr/sbin/mysqld: Normal shutdown

111227 21:37:43 [Note] Event Scheduler: Purging the queue. 0 events
111227 21:37:45  InnoDB: Starting shutdown...
111227 21:37:48  InnoDB: Shutdown completed; log sequence number 0 4272160105
111227 21:37:48 [Note] /usr/sbin/mysqld: Shutdown complete

111227 21:40:33 [Note] Plugin 'FEDERATED' is disabled. /usr/sbin/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13)
111227 21:40:33 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
111227 21:40:33  InnoDB: Operating system error number 13 in a file operation.
InnoDB: The error means mysqld does not have the access rights to
InnoDB: the directory.
InnoDB: File name ./ibdata1
InnoDB: File operation call: 'open'.
InnoDB: Cannot continue operation.

The following is (part of) my my.cnf file:

port            = 3306
socket          = /var/run/mysqld/mysqld.sock

socket          = /var/run/mysqld/mysqld.sock
nice            = 0

user            = mysql
socket          = /var/run/mysqld/mysqld.sock
port            = 3306
basedir         = /usr
datadir         = /storageContainer/mysql
tmpdir          = /tmp

Let me know if you need more info... We would theoretically need to get mysql back up and running without losing anydata ...

Side note: I also checked and we only have 1 instance of the mysql-server.

share|improve this question
The errors that you are experiencing are explained in the logs you pasted. Look for "ERROR". The server is not running. – David Schwartz Dec 28 '11 at 4:24
Check… maybe it can help you – Javier Constanzo Dec 28 '11 at 5:30
@DavidSchwartz Yes, I know it's not running, but I can't get it to start running. Whenever I do server mysql start it just hangs forever and never actually starts... – Aram Papazian Dec 28 '11 at 6:45
@JavierConstanzo Didn't really help as in their instance mysql was remaining running throughout the whole process. Mine isn't running at all. – Aram Papazian Dec 28 '11 at 6:45

The error lines should help you : MySQL can't open files and then stop before doing something nasty. So check why these files can't be opened. ./wordpress/wp_7_rg_form_view.frm and ./mysql/plugin.frm should exists and be writeable for MySQL. Usualy they are in /var/lib/mysql folder in Linux (In your case /storageContainer/mysql). If they exists, check permissions. Do you change something on this server ? If MySQL loose files like this, there is maybe a hardware problem too.

share|improve this answer
All the permissions are correct from the looks of it. (all are 644 with the user mysql as the owner) I don't recall changing something in the server, but it could have been an automated one? I can look into hardware problems too, but we are hosted externally so it might take a little bit of sleuthing. – Aram Papazian Dec 28 '11 at 14:50

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.