Bug #85469 my.ini written to ProgramData but says it should be in Program Files
Submitted: 15 Mar 2017 16:36 Modified: 20 May 2022 19:50
Reporter: John Smith Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL for Windows: Installer Severity:S3 (Non-critical)
Version:MySQL Community 5.7.17.0 msi OS:Windows
Assigned to: CPU Architecture:Any
Tags: my.ini

[15 Mar 2017 16:36] John Smith
Description:
I installed MySQL Community 5.7.17.0 msi

I had difficulty finding my.ini because most online articles claim, incorrectly apparently, that it is supposed to be in %ProgramFiles%

I found it finally in %ProgramData%

This matches the online documentation -- https://dev.mysql.com/doc/refman/5.7/en/option-files.html

However, 
** #1 **

The contents of the file itself state that it is supposed to be in %ProgramFiles%

Quoting excerpt:

# On Windows you should keep this file in the installation directory 
# of your server (e.g. C:\Program Files\MySQL\MySQL Server X.Y). To
# make sure the server reads the config file use the startup option 
# "--defaults-file". 

This suggests to me that perhaps that excerpt that I quoted above might be outdated and wrong?

** #2 **

The template/sample my.ini file is located in %ProgramFiles% not in %ProgramData%

How to repeat:
Install MySQL Community 5.7.17.0

Examine the MySQL directories in %ProgramFiles% and in %ProgramData%

Suggested fix:
If the file is really supposed to be in %ProgramData%, as I infer from the docs on the web (as explained above), 

Update the contents of the installed my.ini to say that it should be in %ProgramData% instead of %ProgramFiles%

Possibly add some explanatory text to the my-default.ini file.
[15 Mar 2017 18:38] John Smith
If perhaps my.ini used to be stored in %ProgramFiles% and then later was moved to %ProgramData%, perhaps add a note to the web docs explaining that. 

That would help explain why the articles on the web all seem to say it should be in %ProgramFiles%.
[16 Mar 2017 5:50] MySQL Verification Team
Thank you for the report and feedback.
[16 Mar 2017 15:55] Peter Laursen
It is stord in %ProgramData% if installation was done with the "MysQL Installer". With earlier installers (up to and including MySQL 5.5) it was in installation folder 

It works from %ProgramData% because the registry key starting the Windows service (if installation was done with the "MysQL Installer") reads like below:

"C:\Program Files\MySQL\MySQL Server 5.7\bin\mysqld.exe" --defaults-file="C:\ProgramData\MySQL\MySQL Server 5.7\my.ini" MySQL57"

-- Peter
-- not a MySQL/Oracle person
[7 May 2022 1:49] Jose Ramirez
Posted by developer:
 
Updated ini files with correct wording.

Doc team,
below page needs to also reflect this change since it currently states that the INI file is located in the program files folder: https://dev.mysql.com/doc/refman/8.0/en/option-files.html
[19 May 2022 21:55] Jose Ramirez
Posted by developer:
 
The templates used to generate the my.ini server options configuration file mentioned that said file was expected to be located in the Program Files folder, however for MySQL Installer it is expected that by default the file is located in the Program Data folder. The templates (which are usually located at C:\ProgramData\MySQL\MySQL Installer for Windows\Manifest\Templates) have since been updated to mention the correct folder.
[20 May 2022 19:50] Christine Cole
Posted by developer:
 
Fixed as of the upcoming MySQL Installer 1.6.3 release, and here's the proposed changelog entry from the documentation team:

The templates used to generate the my.ini server-options file now report
the accurate default location of the installed my.ini file (under
%ProgramData%), rather than misreporting %ProgramFiles% as the file's
default location.

Thank you for the bug report.