How to Restart, Stop, and Start MySQL or MariaDB Server on Linux

I write a weekly newsletter, sharing my articles and thoughts on building and running websites. There’s no spam and it’s totally free.
Join 1500+ subscribers!

Following are a number of methods you can use to start, stop, and restart MySQL or MariaDB database server, depending on your Linux distribution.


To restart MySQL or MariaDB server on Linux, use one of these commands:

sudo service mysql restart
sudo service mysqld restart
sudo /etc/init.d/mysql restart
sudo /etc/init.d/mysqld restart
sudo systemctl restart mysqld
sudo /usr/local/etc/rc.d/mysql-server restart
service mysql restart
service mysql restart

To stop MySQL or MariaDB server on Linux, use one of these commands:

sudo service mysql stop
sudo service mysqld stop
sudo /etc/init.d/mysql stop
sudo /etc/init.d/mysqld stop
sudo systemctl stop mysqld
sudo /usr/local/etc/rc.d/mysql-server stop
service mysql stop
service mysql stop

To start MySQL or MariaDB server on Linux, use one of these commands:

sudo service mysql start
sudo service mysqld start
sudo /etc/init.d/mysql start
sudo /etc/init.d/mysqld start
sudo systemctl start mysqld
sudo /usr/local/etc/rc.d/mysql-server start
service mysql start
service mysql start

Bonus tip: Check MySQL / MariaDB status:

sudo mysqladmin -u root -p status
sudo service mysql status
sudo service mysqld status
sudo /etc/init.d/mysql status
sudo /etc/init.d/mysqld status
sudo systemctl status mysqld
sudo /usr/local/etc/rc.d/mysql-server status
service mysql status
service mysql status
I write a weekly newsletter, sharing my articles and thoughts on building and running websites. There’s no spam and it’s totally free. Join 1500+ subscribers!

Leave a Reply

Close Menu