I have MySQL 5.5 running in RHEL. I have checked for my.cnf file in my filesystem and its available in two destinations. One in the user's home directory and the other is in /data/etc_ORIG directory. It was not seen in /etc or /etc/mysql folder. Is there any issue with the config file present in a different path? And how do I check which config is being used by MySQL?
2 Answers
As your my.cnf is not on standard location, check
ps -ef | grep mysql
for --defaults-file
option.
Below command will give you default file options:
mysqld --verbose --help | grep -A 1 "Default options"
-
ps -ef | grep mysql - doesn't show the --defaults-file for me. It only shows data dir, base dir, plugin dir, user, log error, pid file.– tesla747Jul 29, 2015 at 5:04
-
Try the last blog link anchored to "answered"... it has covered multiple options. Jul 29, 2015 at 5:16
-
-
I saw your question for the same. So the answer to it will be dependent on the answer to this one :) Invited you to a chat. Jul 29, 2015 at 9:22
You can execute the following command to check if my.cnf
is used or note by executing the following command ps -ef |grep mysql
or strace ./mysqld
the first command (ps -ef |grep mysql
) will show you the active mysql service ID and the default cnf
file location, the other one will show you only the location of the cnf
file.
As for the location my the cnf
file it can be anywhere as long as MySQL user can access it and the file has 644 permission level.