How to use “Auto re-start MySQL Server” function


With a VPS with little RAM, when website has massive traffic or attack, lack of RAM will result in death mysql service. Then all websites run on VPS will have error: Error establishing a database connection.

Error establishing a database connection.

Normally, when getting this  erroryou will use this command to restart the MySQL service.

On Centos 6:

On  centos 7:

But you also do not always online to check the MySQL service is working or not. So that, you can use “Auto re-start MySQL Server” function in Database Manage. This function checks the mysql service  every 5 minutes. if MySQL service  die, VPSSIM will auto re-start it.

1. Enable Auto re-start MySQL Server function

The Path to  this function: VPSSIM menu ==>  Database Manage ==> Auto re-Start MySQL Server

Enable Auto re-Start MySQL Server finished

2. Disable Auto re-start MySQL Server function

The Path to  this function: VPSSIM menu ==>  Database Manage ==> Auto re-Start MySQL Server

If you do not want to use Auto re-start MySQL Server function, you can disable it

then

This function does not consume CPU and RAM resources , so i recommend that you  enable this function for your server from the begining of the time you finish setup VPSSIM in your VPS.

Related Post: