Locating MySQL's my.ini on Windows
Finding the MySQL my.ini file on Windows can be a perplexing task. Despite referring to official MySQL documentation, users often encounter difficulties locating this crucial configuration file.
The Hidden Location
For MySQL 5.5.28 installed using the "mysqld --install" method on Windows Server 2008, the my.ini file is not located in the usual installation directory, data directory, or Windows folders. The mystery is compounded by the puzzling query result of "mysql_home" returning "nothing."
Solution for MySQL 5.6 MSI Installs
For MySQL 5.6 MSI-based installs (using the installation wizard), the my.ini file is located in an unexpected spot:
%PROGRAMDATA%\MySQL\MySQL Server 5.6\my.ini
To verify this, open a Windows command shell and enter "echo %PROGRAMDATA%". "C:ProgramData" or similar will be returned.
Reason for the Hidden Location
Unlike previous methods, using this high-priority location for the my.ini file ensures that no other my.ini file will be used, except for the one created during installation. This is a departure from the standard configuration file search order.
To avoid confusion and frustration, remember that placing the my.ini file in "C:Program FilesMySQLMySQL Server 5.6my.ini" or "C:Program Files (x86)MySQLMySQL Server 5.1" will not be effective for MySQL 5.6 MSI-based installs.
The above is the detailed content of Where is My MySQL my.ini File on Windows?. For more information, please follow other related articles on the PHP Chinese website!