Determine which MySQL configuration file is being used

configuration, mysql

Solution

If you are on Linux, then start the 'mysqld' with `strace`, for eg ` strace ./mysqld`.

Among all the other system calls, you will find something like:

stat64("/etc/my.cnf", 0xbfa3d7fc)       = -1 ENOENT (No such file or directory)
stat64("/etc/mysql/my.cnf", {st_mode=S_IFREG|0644, st_size=4227, ...}) = 0
open("/etc/mysql/my.cnf", O_RDONLY|O_LARGEFILE) = 3

So, as you can see..it lists the .cnf files, that it attempts to use and finally uses.

Problem

Is there a command to determine which configuration file MySQL 5.0 is currently using?

Original source

Related problems