How to Check if MySQL or MariaDB Is Installed and Running 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!

You may encounter a situation when you’re not sure if MySQL or MariaDB is installed and running on your Linux machine.

Maybe you’ve just finished installing MySQL/MariaDB and you want to make sure everything’s working properly.

Or you are on a new server, and you don’t know what software is installed on it.

You can use one of the following commands to find out if MySQL/MariaDB is installed and running.

sudo mysql
sudo mysql
sudo mysql
sudo mysql --version
sudo mysql --version
sudo mysql –version
sudo service mysql status
sudo service mysql status
sudo service mysql status
sudo /etc/init.d/mysql status
sudo /etc/init.d/mysql status
sudo /etc/init.d/mysql status

Based on the response, you can tell if MySQL/MariaDB is installed and running or not.

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!