Question

mysql shut itself down on a clean server install?!?

I created a new droplet from a one-click app of phpmyadmin on ubuntu 14.4 then uploaded a wordpress site (did some basic stuff like enable mod rewrite and firewall etc…). Left the server/site alone for a couple of hours and next time I look I see the database is down and I had to restart

This is the mysql error log:

170117 17:39:35 [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.
170117 17:39:35 [Note] Plugin 'FEDERATED' is disabled.
170117 17:39:35 InnoDB: The InnoDB memory heap is disabled
170117 17:39:35 InnoDB: Mutexes and rw_locks use GCC atomic builtins
170117 17:39:35 InnoDB: Compressed tables use zlib 1.2.8
170117 17:39:35 InnoDB: Using Linux native AIO
170117 17:39:35 InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(137363456 bytes) failed; errno 12
170117 17:39:35 InnoDB: Completed initialization of buffer pool
170117 17:39:35 InnoDB: Fatal error: cannot allocate memory for the buffer pool
170117 17:39:35 [ERROR] Plugin 'InnoDB' init function returned error.
170117 17:39:35 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
170117 17:39:35 [ERROR] Unknown/unsupported storage engine: InnoDB
170117 17:39:35 [ERROR] Aborting

170117 17:39:35 [Note] /usr/sbin/mysqld: Shutdown complete

170117 17:39:36 [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.
170117 17:39:36 [Note] Plugin 'FEDERATED' is disabled.
170117 17:39:36 InnoDB: The InnoDB memory heap is disabled
170117 17:39:36 InnoDB: Mutexes and rw_locks use GCC atomic builtins
170117 17:39:36 InnoDB: Compressed tables use zlib 1.2.8
170117 17:39:36 InnoDB: Using Linux native AIO
170117 17:39:36 InnoDB: Initializing buffer pool, size = 128.0M
InnoDB: mmap(137363456 bytes) failed; errno 12
170117 17:39:36 InnoDB: Completed initialization of buffer pool
170117 17:39:36 InnoDB: Fatal error: cannot allocate memory for the buffer pool
170117 17:39:36 [ERROR] Plugin 'InnoDB' init function returned error.
170117 17:39:36 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed.
170117 17:39:36 [ERROR] Unknown/unsupported storage engine: InnoDB
170117 17:39:36 [ERROR] Aborting

170117 17:39:36 [Note] /usr/sbin/mysqld: Shutdown complete

Any ideas what went wrong and how to stop it happening again?


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

@deanzod

It does appear that you’re running out of memory from the details provided. In order to prevent these issues, you should upgrade your droplet. MySQL and forks, such as MariaDB, can be ran on 512MB droplets, but it’s a balancing act and you’d need to be comfortable working from the CLI in order to work on optimizing your configurations.

You can reduce the amount of RAM required by MySQL (or MariaDB) in order to work with less RAM, but what works for a little while may not work long-term. It’s also a trade off. Working with less RAM often means that MySQL won’t perform as well as it should and would with more RAM free.

Looking beyond MySQL, WordPress can sometimes be resource intensive, so it’s important to enable some sort of caching, especially on resource-constrained servers. W3TC and WP Super Cache are two that instantly come to mind when it comes to caching. They will allow you to use PHP’s built-in object caching (if OPCode Caching is enabled), though that too takes RAM (as would Memcached or Redis).

The benefit to enabling caching, however, is that you an reduce the resources required by your web server as a result since instead of constantly performing dynamic operations normally required by WordPress, the caching serves statically generated pages until the cache is updated.

This comment has been deleted

Go with the lines that say ERROR.

170117 17:39:35 InnoDB: Fatal error: cannot allocate memory for the buffer pool

Your droplet needs more memory or you need to make MySQL use less of it.