sudo /etc/init.d/mysql stop code example Example 1: ubuntu restart mysql sudo service mysql restart Example 2: start mysql server ubuntu sudo service mysql-server