Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I check if mysql is installed on ubuntu?

Tags:

mysql

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.

like image 472
Green Lei Avatar asked Dec 23 '14 05:12

Green Lei


People also ask

How do I find MySQL version Ubuntu?

In MySQL Command Line Client, enter the following command: SHOW VARIABLES LIKE 'version'; The MySQL version will be shown instantly.

Is MySQL installed by default on Ubuntu?

d/mysql does not exist, the MySQL server is not installed. After installing it using sudo apt-get install mysql-server , it will be started automatically (after the installation and on startup). Ubuntu has migrated from traditional initscripts to Upstart. If you run /etc/init.

How can I tell if MySQL is running on Linux?

1) execute "mysql -uroot -p" and check if you are able to connect mysql, 2) check if you are able to connect your db from outside either sqlyog, mysqladmin etc. and share output to check the issue. cnf will be /etc/my. cnf not /root/my.


2 Answers

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.

like image 79
hd1 Avatar answered Oct 05 '22 23:10

hd1


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

Faster than rpm -qa | grep mysqld is:

which mysqld 
like image 42
Gerald Schade Avatar answered Oct 05 '22 23:10

Gerald Schade