I found this link for MySQL database:
How to start/stop MySql server on Ubuntu 8.04
# To install MySql database:
sudo apt-get install mysql-server
# To start MySql server:
/etc/init.d/mysql start
# To stop MySql server:
/etc/init.d/mysql stop
# To restart MySql server:
/etc/init.d/mysql restart
# To check the status of MySql server:
/etc/init.d/mysql status
In case you want to investigate why a DB MYSQL can stop or crash you should check the log on the following location:
/var/log/mysql/error.log
Eventually the mysql crash happens for the reason of not having enought memory:
https://www.digitalocean.com/community/questions/mysql-server-keeps-stopping-unexpectedly
And the solution for adding more swap memory is in this link:
https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-ubuntu-14-04