damian
By:
damian

Mysql crashing repeatedly with WordPress on Ubuntu 14.04

October 21, 2014 2.4k views

Created 1gig droplet and gave it 2048m swap.

Most other things are default. Did not change anything with the my.cnf or anything...getting this in my /var/log/mysql/error.log

It seems a little absurd that mysql won't stay running on a droplet image designed for an app that depends on it no?

141021 00:38:05 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
141021 00:38:06 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
141021  0:38:06 [Warning] Using unique option prefix key_buffer instead of key_buffer_size is deprecated and will be removed in a future release. Please use the full name instead.
141021  0:38:06 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead.
141021  0:38:06 [Note] Plugin 'FEDERATED' is disabled.
141021  0:38:06 InnoDB: The InnoDB memory heap is disabled
141021  0:38:06 InnoDB: Mutexes and rw_locks use GCC atomic builtins
141021  0:38:06 InnoDB: Compressed tables use zlib 1.2.8
141021  0:38:06 InnoDB: Using Linux native AIO
141021  0:38:06 InnoDB: Initializing buffer pool, size = 128.0M
141021  0:38:06 InnoDB: Completed initialization of buffer pool
141021  0:38:06 InnoDB: highest supported file format is Barracuda.
141021  0:38:06  InnoDB: Waiting for the background threads to start
141021  0:38:07 InnoDB: 5.5.40 started; log sequence number 4181109
141021  0:38:07 [Note] Server hostname (bind-address): '127.0.0.1'; port: 3306
141021  0:38:07 [Note]   - '127.0.0.1' resolves to '127.0.0.1';
141021  0:38:07 [Note] Server socket created on IP: '127.0.0.1'.
141021  0:38:07 [Note] Event Scheduler: Loaded 0 events
141021  0:38:07 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.5.40-0ubuntu0.14.04.1'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  (Ubuntu)
141021  0:39:04 [Note] /usr/sbin/mysqld: Normal shutdown

141021  0:39:04 [Note] Event Scheduler: Purging the queue. 0 events
141021  0:39:04  InnoDB: Starting shutdown...
141021  0:39:06  InnoDB: Shutdown completed; log sequence number 4181119
141021  0:39:06 [Note] /usr/sbin/mysqld: Shutdown complete

141021 00:39:06 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
141021 00:39:07 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
141021  0:39:07 [Warning] Using unique option prefix key_buffer instead of key_buffer_size is deprecated and will be removed in a future release. Please use the full name instead.
141021  0:39:07 [Warning] Using unique option prefix myisam-recover instead of myisam-recover-options is deprecated and will be removed in a future release. Please use the full name instead.
141021  0:39:07 [Note] Plugin 'FEDERATED' is disabled.
141021  0:39:07 InnoDB: The InnoDB memory heap is disabled
141021  0:39:07 InnoDB: Mutexes and rw_locks use GCC atomic builtins
141021  0:39:07 InnoDB: Compressed tables use zlib 1.2.8
141021  0:39:07 InnoDB: Using Linux native AIO
141021  0:39:07 InnoDB: Initializing buffer pool, size = 128.0M
141021  0:39:07 InnoDB: Completed initialization of buffer pool
141021  0:39:07 InnoDB: highest supported file format is Barracuda.
141021  0:39:07  InnoDB: Waiting for the background threads to start
141021  0:39:08 InnoDB: 5.5.40 started; log sequence number 4181119
141021  0:39:08 [Note] Server hostname (bind-address): '127.0.0.1'; port: 3306
141021  0:39:08 [Note]   - '127.0.0.1' resolves to '127.0.0.1';
141021  0:39:08 [Note] Server socket created on IP: '127.0.0.1'.
141021  0:39:08 [Note] Event Scheduler: Loaded 0 events
141021  0:39:08 [Note] /usr/sbin/mysqld: ready for connections.
Version: '5.5.40-0ubuntu0.14.04.1'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  (Ubuntu)
1 comment
  • It happens. Sometimes a plugin or theme will have something in it that can crash MySQL.

    I made a script you can run with cron to check if MySQL or Apache have crashed. If so, it will restart the service and send you an email letting you know:

    https://github.com/sierracircle/services-checker

    But that is not the fix, it is just way to track what is happening and keep your website going while you trouble-shoot.

    Next you might consider disabling plugins, and then re-enabling them one by one. If a particular plugin is enabled and suddenly crashes start, you have found your culprit.

    If disabling plugins does not stop the crashes, you can switch (temporarily) to one of the default WordPress themes, and see if crashes stop.

    If that does not work, you might start checking to see if brute-force attacks could be causing the crash. (login-lockdown Wordpress plugin is good for that)

2 Answers

This question was answered by @sierracircle:

It happens. Sometimes a plugin or theme will have something in it that can crash MySQL.

I made a script you can run with cron to check if MySQL or Apache have crashed. If so, it will restart the service and send you an email letting you know:

https://github.com/sierracircle/services-checker

But that is not the fix, it is just way to track what is happening and keep your website going while you trouble-shoot.

Next you might consider disabling plugins, and then re-enabling them one by one. If a particular plugin is enabled and suddenly crashes start, you have found your culprit.

If disabling plugins does not stop the crashes, you can switch (temporarily) to one of the default WordPress themes, and see if crashes stop.

If that does not work, you might start checking to see if brute-force attacks could be causing the crash. (login-lockdown Wordpress plugin is good for that)

View the original comment

This question was answered by @sierracircle:

It happens. Sometimes a plugin or theme will have something in it that can crash MySQL.

I made a script you can run with cron to check if MySQL or Apache have crashed. If so, it will restart the service and send you an email letting you know:

https://github.com/sierracircle/services-checker

But that is not the fix, it is just way to track what is happening and keep your website going while you trouble-shoot.

Next you might consider disabling plugins, and then re-enabling them one by one. If a particular plugin is enabled and suddenly crashes start, you have found your culprit.

If disabling plugins does not stop the crashes, you can switch (temporarily) to one of the default WordPress themes, and see if crashes stop.

If that does not work, you might start checking to see if brute-force attacks could be causing the crash. (login-lockdown Wordpress plugin is good for that)

View the original comment

Have another answer? Share your knowledge.