0

I'm not a sys-admin, but sometimes I play one at work.

I've inherited a virtual server that had MySQL installed from source. I'm gathering as much information about the install as I can (original people who installed it are, of course, not a resource).

How can I find

  1. The default/current location of the MySQL binary files (often stored in a directory named data?)

  2. Any default or custom loaded cnf files?

Looking for solutions that are a bit more sophisticated than a find / -iname '*.cnf' :)

1 Answer 1

1

When compiling from source, /usr/local is the default prefix. Some people like to use the standard system-wide locations, such as /usr, instead even though it could be argued that it breaks the hierarchy standards.

MySQL's default directory to store all variable files such as configuration and databases is data. The default system-wide configuration file is my.cnf.

Ultimately, short of searching the filesystem, would be to look at the process list (ps aufx) and see where MySQL is running from, as the parameters MySQL is started with would identify its location.

2
  • Good info, thanks. Getting a process list netted me the data directory (/usr/local/mysql/var), but it looks like there are only sample/test cnf files in the /usr/local/mysql and none was provided for in the process list. Any tips for ferretting that that? (and is a cnf file required? Will MySQL load with default values if one isn't configured?) Apr 7, 2010 at 18:02
  • 1
    MySQL will load with default values if no cnf is located, yes. Unless specified otherwise, it will load the cnf from the data directory. I'd still recommend searching the filesystem for all instances of the .cnf. You can show the running configuration by running show variables; within the client.
    – Warner
    Apr 7, 2010 at 18:28

You must log in to answer this question.

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