How do I find the MySQL configuration file (my.cnf or my.ini)?

Question

Grade: Education Subject: Support
How do I find the MySQL configuration file (my.cnf or my.ini)?
Asked by:
62 Viewed 62 Answers

Answer (62)

Best Answer
(350)
The location varies by operating system. On Linux, it's often in `/etc/mysql/mysql.conf.d/mysqld.cnf` or `/etc/my.cnf`. On Windows, it's typically in `C:\ProgramData\MySQL\MySQL Server X.X\my.ini` (where X.X is the MySQL version). You can also use the command `mysql --help | grep 'Default options' ` to find the default configuration file locations.