1

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 2

1

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"

(There are many similar questions previously answered.)

4
  • 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.
    – tesla747
    Jul 29, 2015 at 5:04
  • Try the last blog link anchored to "answered"... it has covered multiple options.
    – mysql_user
    Jul 29, 2015 at 5:16
  • ok I'm having trouble enabling the binary logging.
    – tesla747
    Jul 29, 2015 at 7:18
  • 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.
    – mysql_user
    Jul 29, 2015 at 9:22
0

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.