23

I am currently using Red Hat linux. I just want to find out whether MySQL is installed in that system. If yes where is it located? can anyone help please...

NoWar
  • 36,338
  • 80
  • 323
  • 498
satheesh.droid
  • 29,947
  • 10
  • 34
  • 34

6 Answers6

30

Type mysql --version to see if it is installed.

To find location use find -name mysql.

Shoaib Iqbal
  • 1,208
  • 11
  • 21
Ankit
  • 2,753
  • 1
  • 19
  • 26
  • 7
    `find -name mysql` will only work if your working directory is `/` or `/usr` (or whatever component of the `mysql` location). `which mysql` is better if you want to locate a binary as it searches in the directories of `$PATH` only. – Lekensteyn May 12 '11 at 07:02
18

If you're looking for the RPM.

rpm -qa | grep MySQL

Most of it's data is stored in /var/lib/mysql so that's another good place to look.

If it is installed

which mysql

will give you the location of the binary.

You could also do an

updatedb

and a

locate mysql

to find any mysql files.

Echo419
  • 490
  • 3
  • 9
5

yum list installed | grep mysql

Then if it's not installed you can do (as root)

yum install mysql -y
sweaves
  • 572
  • 6
  • 18
1

to ckeck the status use the below command, which worked on debian....

/etc/init.d/mysql status

to start my sql server use the below command

/etc/init.d/mysql start

to stop the server use the below command

/etc/init.d/mysql stop

Jacob Abraham
  • 915
  • 9
  • 8
0

Usually you can find a program under a subdirectory "../bin". System programs are under /usr/bin or /bin. To check where files of mysql package are placed, on RHEL 6 type like this :

rpm -ql mysql (which is the main part of the package)

and the result is a list of "exe" files such as "mysqladmin" tool. About to know the version of the server, run the command:

mysqladmin -u "valid-user" version

0

rpmquery <package Name> By this command you can check which package is installed.

For Example: rpmquery mysql

Aman Gupta
  • 5,548
  • 10
  • 52
  • 88