Where is my.cnf (or my.ini on Windows) located?

There are different ways to find and locate my.cnf (or my.ini on Windows) file if you have installed mysql in your system.

Using mysql:

You can actually request MySQL for a list of all locations from where it searches and loads my.cnf (or my.ini on Windows).

Using brute force search on Linux:

Using brute force search on Windows:

The default location of my.cnf file for Linux:

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

The default location of my.cnf file for Linux:

Default options are read from the following files in the given order:

  • C:\Windows\my.ini
  • C:\Windows\my.cnf
  • C:\my.ini
  • C:\my.cnf
  • C:\Program Files\MySQL\MySQL Server <version>\my.ini
  • C:\Program Files\MySQL\MySQL Server <version>\my.cnf

Leave a Reply