How can I check if mysql is installed on ubuntu?

I need to check if mysql is installed on a ubuntu server. Is there a way to determine if mySql has been installed ? Thanks.


Solution 1:

You can use tool dpkg for managing packages in Debian operating system.

Example

dpkg --get-selections | grep mysql if it's listed as installed, you got it. Else you need to get it.

Solution 2:

"mysql" may be found even if mysql and mariadb is uninstalled, but not "mysqld".

Faster than rpm -qa | grep mysqld is:

which mysqld