I have installed MySQL 5.1.73-community edition in my Oracle LINUX 5 server. I am able to start / stop and execute MySQL commands. But, I am unable to locate the MySQL installation directory as well as my.cnf file where I can change the configuration as per my requirements.

  • Isn't it simply in /etc?
    – enedil
    Apr 22, 2014 at 10:49
  • No, its not there.
    – ursitesion
    Apr 22, 2014 at 11:00
  • 1
    Explaining where you've looked would be good so we do not get a pointless sequence of "Isn't it in ___?", "No, I've looked in ____" comments.
    – goldilocks
    Apr 22, 2014 at 11:01
  • I looked it in (1)/etc/, (2)/var/lib, (3)/opt directories.
    – ursitesion
    Apr 22, 2014 at 11:03
  • I run the command - $ find /etc my.cnf
    – ursitesion
    Apr 22, 2014 at 11:04

2 Answers 2

#locate my.cnf

This command will help you to find the path of the file.

  • I got below resultset: $ locate my.cnf /usr/share/mysql-test/include/default_my.cnf /usr/share/mysql-test/suite/federated/my.cnf /usr/share/mysql-test/suite/ndb/my.cnf /usr/share/mysql-test/suite/rpl/my.cnf /usr/share/mysql-test/suite/rpl_ndb/my.cnf
    – ursitesion
    Apr 22, 2014 at 11:54
  • Which one is the correct one?
    – ursitesion
    Apr 22, 2014 at 11:57
  • cp default_my.cnf /etc/my.cnf
    – pravin09
    Apr 22, 2014 at 12:13

I am able to start / stop and execute MySQL commands.

You should be able to get a clue then from whereis + a command name. This may be just /usr/bin, of course, but it also may have added to $PATH instead when installing.

Run strace whatevercommand | grep '.cnf' on a command that uses these config files. This should give the path inside an open() call; see man strace if you are unfamiliar with this command (in which case, you also may have to install it first from a small distro package).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .