Mysql – Why is MYSQL not starting

MySQL

When running the command 'sudo service mysql start' this is the output.
[FAIL] Starting MySQL database server: mysqld . . . . . . . . . . . . . . failed!

Here are the steps taken to troubleshoot already:
1. Checked permissions for /var/run/mysqld, it's owned by mysql but the user is root.
2. The syslog file has been checked and gives the following,

ERROR 2002 (HY000): 'Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!

After checking the my.cnf file the path's for the socket matched.

When running which mysql this is the output /usr/bin/mysql

Monit has recently been installed on the server as well as the port was changed to port 99.

Everything has been running fine up until now. (About a week and a half after said changes were made.)

Linode has been rebooted a couple of times to troubleshoot memory issues but to no avail. Here is some output from various commands

            user@hostname:~$ df -h
            Filesystem      Size  Used Avail Use% Mounted on
            /dev/root        24G  7.3G   16G  32% /
            devtmpfs        494M     0  494M   0% /dev
            tmpfs           100M  208K   99M   1% /run
            tmpfs           5.0M     0  5.0M   0% /run/lock
            tmpfs           250M     0  250M   0% /run/shm

            user@hostname:~$ df -i
            Filesystem      Inodes  IUsed   IFree IUse% Mounted on
            /dev/root      1556480 177140 1379340   12% /
            devtmpfs        126432   1379  125053    2% /dev
            tmpfs           126898    780  126118    1% /run
            tmpfs           126898      2  126896    1% /run/lock
            tmpfs           126898      2  126896    1% /run/shm

            user@hostname:~$ free -m
                         total       used       free     shared    buffers     cached
            Mem:           991        501        489          0         52        237
            -/+ buffers/cache:        211        779
            Swap:          255          0        255

We have ruled out the possibility of a failed mysql process that is still running with the following commands

            user@hostname:/var/run/mysqld$ ps aux | grep mysql
            user  28834  0.0  0.2   7856  2068 pts/0    S+   13:00   0:00 grep mysql
            user@hostname:/var/run/mysqld$ kill
            kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
            user@hostname:/var/run/mysqld$ kill mysql
            -bash: kill: mysql: arguments must be process or job IDs
            user@hostname:/var/run/mysqld$ kill 28834
            -bash: kill: (28834) - No such process
            user@hostname:/var/run/mysqld$ kill 7856
            -bash: kill: (7856) - No such process
            user@hostname:/var/run/mysqld$ kill 2068
            -bash: kill: (2068) - No such process
            user@hostname:/var/run/mysqld$ man kill
            user@hostname:/var/run/mysqld$ kill -l
             1) SIGHUP   2) SIGINT   3) SIGQUIT  4) SIGILL   5) SIGTRAP
             6) SIGABRT  7) SIGBUS   8) SIGFPE   9) SIGKILL 10) SIGUSR1
            11) SIGSEGV 12) SIGUSR2 13) SIGPIPE 14) SIGALRM 15) SIGTERM
            16) SIGSTKFLT   17) SIGCHLD 18) SIGCONT 19) SIGSTOP 20) SIGTSTP
            21) SIGTTIN 22) SIGTTOU 23) SIGURG  24) SIGXCPU 25) SIGXFSZ
            26) SIGVTALRM   27) SIGPROF 28) SIGWINCH    29) SIGIO   30) SIGPWR
            31) SIGSYS  34) SIGRTMIN    35) SIGRTMIN+1  36) SIGRTMIN+2  37) SIGRTMIN+3
            38) SIGRTMIN+4  39) SIGRTMIN+5  40) SIGRTMIN+6  41) SIGRTMIN+7  42) SIGRTMIN+8
            43) SIGRTMIN+9  44) SIGRTMIN+10 45) SIGRTMIN+11 46) SIGRTMIN+12 47) SIGRTMIN+13
            48) SIGRTMIN+14 49) SIGRTMIN+15 50) SIGRTMAX-14 51) SIGRTMAX-13 52) SIGRTMAX-12
            53) SIGRTMAX-11 54) SIGRTMAX-10 55) SIGRTMAX-9  56) SIGRTMAX-8  57) SIGRTMAX-7
            58) SIGRTMAX-6  59) SIGRTMAX-5  60) SIGRTMAX-4  61) SIGRTMAX-3  62) SIGRTMAX-2
            63) SIGRTMAX-1  64) SIGRTMAX

Best Answer

You may have corruption in your database. Add the following to your my.cnf under [mysqld] file and see if mysql will start

innodb_force_recovery = 1

Increment the value as needed. See http://dev.mysql.com/doc/refman/5.5/en/forcing-innodb-recovery.html