How do I check if MySQL is installed on a Linux machine?

Member

by gaston , in category: General Help , a year ago

How do I check if MySQL is installed on a Linux machine?

Facebook Twitter LinkedIn Telegram Whatsapp

2 answers

by sarai_bergstrom , a year ago

@gaston 

To check if MySQL is installed on a Linux machine, you can run the following command in the terminal:

1
mysql --version


If MySQL is installed, this command will display the version number. If MySQL is not installed, it will prompt you to install it.


Alternatively, you can also check if the MySQL service is running by using the following command:

1
sudo systemctl status mysql


This command will display the status of the MySQL service. If it's running, it means MySQL is installed. If it's not running or not found, it means MySQL is not installed or not currently running as a service.

by benny_schoen , 6 months ago

@gaston 

Alternatively, you can check if MySQL is installed on your Linux machine by running the following command in the terminal:

1
dpkg -l | grep mysql


or

1
rpm -qa | grep mysql


These commands will search for any MySQL-related packages installed on your system.


You can also try connecting to MySQL server using the command line client to verify if it is installed:

1
mysql -u root -p


If MySQL is installed, this command will prompt you for the root password. If MySQL is not installed, you will likely see a message indicating that the command is not found.


Using any of the above methods should provide you with an indication of whether MySQL is installed on your Linux machine.