Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Seems that I cannot locate mysql DIR only bunch of binary files under /usr/bin

I used yum to install


and tried to install mysql and I used /init.d/mysqld to have started it.

But when I want to compile PHP , the option --with-mysql need the base DIR of mysql ...where should I use? /usr/bin?

share|improve this question
up vote 3 down vote accepted

You should run this command

mysqladmin -uroot variables | grep datadir | sed 's/|/ /g' | awk '{print $2}'

to find the default data directory.

If you cannot login to mysql just yet, you can still run this

which mysqld
which mysqld_safe

to locate the binaries.

Give it a Try !!!

share|improve this answer

Have you tried: /usr/local/mysql/bin?

share|improve this answer
no mysql directory under /usr/local – Hao May 23 '11 at 3:45
Did you look in /usr/bin for the binaries? – Justin Pearce May 23 '11 at 18:51
Yes, that's the only place that I thought MySQL yum install had been installed files to.. – Hao May 24 '11 at 6:41
Depending upon the distro and/or package it usually puts things in either /usr/bin or /usr/local/bin. Glad you got it sorted! – Justin Pearce May 24 '11 at 18:43

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.