Find out where my.cnf is located

To find out where the MySQL configuration (my.cnf) is stored, you can use the strace command:

You will get an output showing all the paths the MySQL deamon searches for the my.cnf upon startup like that:

As you can see, the service searches the following files:

  • /etc/my.cnf
  • /etc/mysql/my.cnf
  • /usr/etc/my.cnf
  • /home/sheldon/.my.cnf

But only the /etc/mysql/my.cnf is found and was used. That’s the my.cnf you where looking for.

Leave a Reply

Your email address will not be published. Required fields are marked *

 

This site uses Akismet to reduce spam. Learn how your comment data is processed.