I'm trying to determine which my.cnf mysql is using. Is there a command or something for mysql or mysqladmin that shows which one is being loaded?
d/mysql start 2>&1|grep my. cnf should show you the system call used to open the file.
cnf, /usr/my. This file contains configuration settings that will be loaded when the server is first started including settings for the clients, server, mysqld_safe wrapper and various other mysql client programs. Note: As of 5.6 version, the my. cnf is written, but all the lines are commented out.
On my linux servers in the startup script (/etc/init.d/mysql) it defines
CONF=/etc/mysql/my.cnf
that it uses to start MySQL daemon
EDIT:
also running
mysqld --verbose --help
shows the following info:
Default options are read from the following files in the given order:
/etc/my.cnf /etc/mysql/my.cnf /usr/etc/my.cnf ~/.my.cnf
So if run as a daemon through init script it will look into /etc/mysql/my.cnf and if started from the command line it will look there only on the second attempt.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With