Starting, Stopping and Restarting MySQL on Ubuntu

To start, stop, and restart the MySQL service on Ubuntu, you can use the /etc/init.d/mysql script.

You need to ssh to your Pod as root, or use sudo command. Here are each of the commands:

Start:

root@mypod:~# sudo /etc/init.d/mysql start

Stop:

root@mypod:~# sudo /etc/init.d/mysql stop

Restart:

root@mypod:~# sudo /etc/init.d/mysql restart

 
 

A different way to do this, is to use “upstart” (which is what /etc/init.d/mysql links to) which works as follows:

Start:

root@mypod:~# sudo start mysql

Stop:

root@mypod:~# sudo stop mysql

Restart:

root@mypod:~# sudo restart mysql

Matthew McCaffrey

Leave a Reply