Finally this helped, none of other solution did any change (add swap, monitor for banned iP’s, upgrade droplet):
## Edit /etc/my.cnf, and add the following line under the [mysqld] heading. [mysqld] innodb_buffer_pool_size=64M
$ service mysql restart
This is a pretty common issue with WordPress, certainly not the fault of the DO preconfigured instance as I’ve experienced the same spinning up my own DO instances as well as back when I used to use AWS EC2. Moving up to an instance with more memory may help temporarily, but you’ll likely still eventually come face to face with this issue.
My sites will typically work flawlessly for several months until eventually they start to become plagued with MySQL crashes. My solution almost always ends up being spinning up a new instance and migrating over where the 2-4 month cycle just repeats itself. I’ve yet to be able to pin down the root cause or a solution.
I’ve added a swap file but it keeps crashing. Any idea how to find out why it is happening or how to fix it?
MySQL instance used to crash once every few months. Lately there was a lot of attempted login on my Wordpress instance and crashes the DB every 2-3 days.
Now I try to restart the DB only to see it eating up all the memory within a minute. I have 1 GB RAM and added 2 GB swap and it runs out of memory in less than 5 mins when I start the DB.
I’ve had this MySQL problem on several droplets. All are Ubuntu 14.04 at present and were originally set up as Wordpress instances. However, I don’t use them for Wordpress, so deleting the Wordpress part of the droplet is the first thing I do. This is just for reference.
Initially through this and similar community posts I set up a swap file on each system. But, that never solved my problem on any droplet.
In each instance to date that I’ve had this MySQL problem I’ve found that there were MySQL tables that were marked as crashed. Once I ran mysqlcheck to resolve the crash indications it seems I no longer am having problems.
Hope this is helpful.