Server was OOMing, now MySQL server won't start

So this morning my server started running out of memory due ( I assume ) to some code changes I made last night. I reverted some of the code changes, shut down and then restarted my Linode, and everything worked fine.

About an hour later, the same thing started happening. So I reverted a few more changes, and did a Reboot on the Linode. Now my MySQL server doesn't appear to want to start.

> mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
> start mysql
start: Job failed to start
> restart mysql
restart: Unknown instance:
> /etc/init.d/mysql start
Rather than invoking init scripts through /etc/init.d, use the service(8)
utility, e.g. service mysql start

Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the start(8) utility, e.g. start mysql
start: Job failed to start

I didn't make any other changes to the server besides some minor changes to PHP files. I am still relatively new to sysadmin and am at a total loss for how I can get mysql up and running again, or why it would have stopped starting up in the first place.

I am running the LAMP StackScript available from the Linode StackScript repository.

Originally created using Ubuntu 10.04 LTS and 'LAMP Stack' StackScript at revision 160

Any help is greatly appreciated.

4 Replies

What's the content of /var/log/mysql/error.log

@obs:

What's the content of /var/log/mysql/error.log

/var/log/mysql/error.log was:

110317 14:43:34 [Note] Plugin 'FEDERATED' is disabled.
110317 14:43:35 InnoDB: Started; log sequence number 0 44233
110317 14:43:35 [Note] Event Scheduler: Loaded 0 events
110317 14:43:35 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.1.41-3ubuntu12.7' socket: '/var/run/mysqld/mysqld.sock' port: 3306 (Ubuntu)
110317 14:43:37 [ERROR] /usr/sbin/mysqld: Incorrect key file for table '/tmp/#sql_e83_0.MYI'; try to repair it
110317 15:36:49 [Note] /usr/sbin/mysqld: Normal shutdown

110317 15:36:49 [Note] Event Scheduler: Purging the queue. 0 events
110317 15:36:51 InnoDB: Starting shutdown...

I recently tried to run sudo -u mysql mysql and it added this to the error.log

110317 14:43:34 [Note] Plugin 'FEDERATED' is disabled.
110317 14:43:35  InnoDB: Started; log sequence number 0 44233
110317 14:43:35 [Note] Event Scheduler: Loaded 0 events
110317 14:43:35 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.1.41-3ubuntu12.7'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  (Ubuntu)
110317 14:43:37 [ERROR] /usr/sbin/mysqld: Incorrect key file for table '/tmp/#sql_e83_0.MYI'; try to repair it
110317 15:36:49 [Note] /usr/sbin/mysqld: Normal shutdown

110317 15:36:49 [Note] Event Scheduler: Purging the queue. 0 events
110317 15:36:51  InnoDB: Starting shutdown...
110317 17:46:18 [Note] Plugin 'FEDERATED' is disabled.
110317 17:46:18  InnoDB: Started; log sequence number 0 44233
110317 17:46:18 [ERROR] mysqld: Error writing file '/var/lib/mysql/li79-201.pid' (Errcode: 28)
110317 17:46:18 [ERROR] Can't start server: can't create PID file: No space left on device
110317 17:46:50 [Note] Plugin 'FEDERATED' is disabled.
110317 17:46:51  InnoDB: Started; log sequence number 0 44233
110317 17:46:51 [ERROR] mysqld: Error writing file '/var/lib/mysql/li79-201.pid' (Errcode: 28)
110317 17:46:51 [ERROR] Can't start server: can't create PID file: No space left on device

Am I out of disk space? Is that what is causing all of my problems?

Looks like it run df -h to see your disk usage, run du -h / | grep '.*[0-9][0-9]M' to find directories over 10mb on your linode.

Disk space was indeed my problem. I added 5G from Extras and resized my disk image to give me time to figure out a better storage solution. Thank you for your help!

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct