Home >Database >Mysql Tutorial >Where Is My MySQL my.ini File Located After a Windows MSI Installation?
MySQL my.ini File Location on Windows with MySQL Server 5.6 MSI Installation
For users struggling to locate the MySQL my.ini file on Windows, especially with MySQL Server 5.6 installed using the MSI installer, this article provides a definitive solution.
Determining the my.ini Location
Contrary to popular guidance, the my.ini file is not typically located in the C:Program FilesMySQLMySQL Server 5.6 directory on Windows. Instead, it is recommended to use the following command in a Windows command shell:
echo %PROGRAMDATA%
This command will typically return a directory path such as C:ProgramData.
According to the MySQL documentation (http://dev.mysql.com/doc/refman/5.6/en/option-files.html), the first location MySQL will look for the my.ini file is:
%PROGRAMDATA%\MySQL\MySQL Server 5.6\my.ini
In most cases, this is where the my.ini file will be found.
Overriding the Default Location
If you prefer to use a different location for the my.ini file, you can create one in the directory of your choice and specify its location using the --defaults-file option when starting the MySQL service. For example:
mysqld --defaults-file=C:\Path\To\Custom\my.ini
The above is the detailed content of Where Is My MySQL my.ini File Located After a Windows MSI Installation?. For more information, please follow other related articles on the PHP Chinese website!