0

I am using

whereis mysql  

in my terminal to get exact location of my MySQL installation, but it's showing too many locations:

mysql: /usr/bin/mysql /etc/mysql /usr/lib/mysql /usr/bin/X11/mysql /usr/share/mysql /opt/lampp/bin/mysql /opt/lampp/bin/mysql.server /usr/share/man/man1/mysql.1.gz  

Does it mean that I have installed MySQL more than once?

Warren Young
  • 72,032
Haider Ali
  • 633
  • 1
  • 6
  • 10

2 Answers2

1

What you're seeing is all the directories called mysql, which are all part of the package you've installed.

If you're on a Debian-like system (including Ubuntu), you can do

dpkg -l | grep mysql

which will give you a list of mysql-related packages installed. To reconcile these results with those from whereis, you can find a list of files installed by a particular package, e.g.

dpkg -L mysql-server-5.5
Flup
  • 8,145
1

I believe you could use something like

which mysql

to find out location of mysql.

With that command you would get:

user@machine ~ $ which mysql
/usr/bin/mysql

Is that what you are looking for?

Ivan
  • 11
  • yes but it's giving me too many paths and i need to figure out which MySQL is running at the moment. – Haider Ali Aug 14 '13 at 18:06
  • whereis command would give you output like mysql: /usr/bin/mysql /usr/lib/mysql /usr/lib64/mysql /usr/include/mysql /usr/sh are/mysql /usr/share/man/man1/mysql.1.bz2 (it gives you all locations with mysql) but which should give you location of mysql executable (mysql that you are using) or maybe i'm wrong. – Ivan Aug 14 '13 at 18:11