1. Check CRASH ADDRESS in MySQL
Problem
Insufficient Memory is one of the major reason in SQL crash, i recommend to review the MySQL error log .
$ sudo systemctl start mysql
To review crash error logs:
$ sudo less /var/log/mysql/error.log
Solution
- Reducing your web application’s dependency . You can simply do it by adding static caching to your application. For an Examples JOOMLA, which has caching built-in feature that can be enabled also a WP Super Cache, a WordPress plugin will also reduce web application dependecny.
- Upgrading Virtual Private server storage size I recommend minmum 1GB of RAM for server using MySQL database, but the size and type of your data can significantly affect memory requirements.
- Configuration Optimization I would recommend to use open-source tool MySQLtuner. Running the MySQLtuner script will output a set of recommended adjustments to your MySQL configuration file (
mysqld.cnf
). - Memory Estimation I would recommend to use open-source tool MySQL Calculator. it will get a memory usage estimate for current settings and the one proposed by MySQLTime.
- Upgrading Server Definately the last resort is cost impacting one of the best potential solution. An upgraded server with more resources will allow resizing can be the last option.
Also, please note MySQL documentation include other preventive way of diagnosing crashes.
Download from the link below.
MySQL What to Do If MySQL Keeps Crashing