How do I know which configuration file is used by MySQL currently? Is there any command or something to find it out?
On RH systems, MySQL configuration file is located under /etc/my. cnf by default.
conf. d/mysqld. cnf which only has [mysqld] pid-file = /var/run/mysqld/mysqld.
The information you want can be found by running
mysql --help
or
mysqld --help --verbose
I tried this command on my machine:
mysql --help | grep "Default options" -A 1
And it printed out:
Default options are read from the following files in the given order: /etc/my.cnf /usr/local/etc/my.cnf ~/.my.cnf
See if that works for you.
mysqld --help --verbose will find only location of default configuration file. What if you use 2 MySQL instances on the same server? It's not going to help.
Good article about figuring it out:
"How to find MySQL configuration file?"
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