MySQL keeps crashing in Ubuntu 12.04
Every few hours, MySQL crashes on my Digital Ocean Ubuntu 12.04 machine. Below is the errors I am seeing in my MySQL error log. I thought it was a memory issue, so I added a swap, but that didn't fix it.
140806 11:58:57 [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.
140806 11:58:57 [Note] Plugin 'FEDERATED' is disabled.
140806 11:58:57 InnoDB: The InnoDB memory heap is disabled
140806 11:58:57 InnoDB: Mutexes and rw_locks use GCC atomic builtins
140806 11:58:57 InnoDB: Compressed tables use zlib 1.2.3.4
140806 11:58:58 InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(137363456 bytes) failed; errno 12
140806 11:58:58 InnoDB: Completed initialization of buffer pool
140806 11:58:58 InnoDB: Fatal error: cannot allocate memory for the buffer pool
140806 11:58:58 [ERROR] Plugin 'InnoDB' init function returned error.
140806 11:58:58 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
140806 11:58:58 [ERROR] Unknown/unsupported storage engine: InnoDB
140806 11:58:58 [ERROR] Aborting
140806 11:58:58 [Note] /usr/sbin/mysqld: Shutdown complete
Here is a look at my memory (free -m):
total used free shared buffers cached
Mem: 2003 384 1619 0 12 50
-/+ buffers/cache: 321 1682
Swap: 511 18 493
Can someone please help me figure out how I can stop this from happening?
The error is in the log:
Fatal error: cannot allocate memory for the buffer pool
As a quick solution you have here 2 options:
-
add more RAM to the server, or
-
decrease the value of
innodb-buffer-pool
size in the config file:innodb_buffer_pool_size = 10M