Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I want a standard way to locate mysql config directories, On linux this becomes a little easy with mysqld --help --verbose, but I am still little puzzled how to get the install directories ( that's where I suppose the my.ini file should be). I would most appreciate if we could get these search paths using a sql query statement ( show ??)

Update: I am specifically looking for a way to do it on Windows. I know so far that my.ini is kept in windows MySQL install dir, but through query how do I ascertain this location?

share|improve this question
    
Which distribution? –  Hyppy Mar 23 '11 at 18:13
    
Wouldn't mysqld.exe --help --verbose give you the same information on windows? –  3molo Mar 24 '11 at 8:10
    
@3molo ..yes mysqld.exe --help --verbose gives you the same results, although locating the mysqld.exe is again pain in windows if its not already on system path. I have found one way to do it. Lookup the registry entry for MySQL, its in HKEY_LOCAL_MACHINE\SOFTWARE\MySQL AB\MySQL Server N.n (Where N.n is the version), in it the Location key gives you the install path for MySQL install directory. This way I can find the options file for all instances installed. –  Hemanshu Mar 25 '11 at 4:15

1 Answer 1

What about

# whereis my.cnf
my: /etc/my.cnf /etc/my.stopwords

(tested this on RHEL 5)

share|improve this answer

Your Answer

 
discard

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.