Jump to: navigation, search

MySQL Check database status and installation location

From w3cyberlearnings

Find the location of MySQL install

sophal@sophal-desktop:~$ whereis mysql
mysql: /usr/bin/mysql /etc/mysql /usr/lib/mysql 
/usr/include/mysql /usr/share/mysql /usr/share/man/man1/mysql.1.gz

Checking whether the mysql run or not

sophal@sophal-desktop:~$ ps -ef | grep mysqld
root      5643     1  0 Feb04 ?        00:00:00 /bin/sh /usr/bin/mysqld_safe
mysql     5685  5643  0 Feb04 ?        00:01:37 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql 
--user=mysql --pid-file=/var/run/mysqld/mysqld.pid --skip-external-locking --port=3306 --socket=/var/run/mysqld/mysqld.sock
root      5686  5643  0 Feb04 ?        00:00:00 logger -p daemon.err -t mysqld_safe -i -t mysqld
sophal   11173  7260  0 23:10 pts/0    00:00:00 grep mysqld
sophal@sophal-desktop:~$ 

How to list all the database file using command line

root@sophal-desktop:/# ls /var/lib/mysql
Navigation
Web
SQL
MISC
References