How to modify the configuration file (my. ini) of MySQL5.6 in Windows: bitsCN.com
How to modify the configuration file (my. ini) of MySQL 5.6 in Windows
This is also a small experience. As required by the experiment, I need to modify the MySQL configuration file my. ini. Before MySQL 5.6.8, the configuration file is directly placed in the installation directory. In a later version, MySQL searches for the my. ini file in the following order during startup:
File Name Purpose%PROGRAMDATA%/MySQL/MySQL Server 5.6/my.ini, %PROGRAMDATA%/MySQL/MySQL Server 5.6/my.cnf Global options%WINDIR%/my.ini, %WINDIR%/my.cnf Global optionsC:/my.ini, C:/my.cnf Global optionsINSTALLDIR/my.ini, INSTALLDIR/my.cnf Global optionsdefaults-extra-file The file specified with --defaults-extra-file=path, if any%APPDATA%/MySQL/.mylogin.cnf
However, when I tried to do this today, I encountered an unpleasant problem. When I first did not see the official documentation, I searched several websites in English and Chinese. the INI file is located in the C:/ProgramData/MySQL Server 5.6 Directory. after reading it, I did not find this directory, so I created a new one. I restarted the MySQL service many times and never found that the configuration worked.
When I was puzzled, I accidentally saw the shortcut configuration of MySQL Command Line MySQL 5.6 Command Line Client. the target column says "D: /Program Files/MySQL Server 5.6/bin/mysql.exe "" -- defaults-file = D:/ProgramData/MySQL Server 5.6/my. ini ""-uroot ""-p "suddenly realized that there was an identical folder under drive D (because I installed MySQL to drive D), according to the above table, my. ini is the first to load.
I need to modify the maximum number of connections of MySQL. for example, here I change it to 50 and change it in my. ini:
[plain] max_connections=50
Restart the MySQL service and enter the following in the MySQL command line:
[plain] show variables like '%max_connections%';
The maximum number of connections is changed to 50.
BitsCN.com