how can i save permanently settings of MySQL ?
i got MySQL from WAMP, and there is no my.cnf file, there is a my.ini file !
how can i set some global variable,

- 17,065
- 35
- 101
- 159
-
1`my.ini`, `my.cnf`, `my.blabla` - does it matter what the file's extension is? – zerkms Apr 22 '11 at 13:06
-
1If you don't know that my.cnf = my.ini then yes it absolutely matters what the file's extension is... For example in my apigen folder I have three files called apigen.bat, apigen.phar and apigen.php - so if I want to edit the settings for this program I can just choose any file to edit, because the extension doesn't matter??? Clearly not. – user3640967 Oct 05 '15 at 11:35
4 Answers
Drive:\wamp\bin\mysql\mysql5.5.8\my.ini
this is the place to save settings.

- 17,065
- 35
- 101
- 159
WAMP uses the my.ini file.
To get to your my.ini file, just click the WAMP tray icon and hover over the 'MySQL' menu, and click 'my.ini'.
Edit your my.ini file and under the [mysqld] section, add this:
setting-name=setting-value
, example: event-scheduler=onrestart all services
You do not need to use quotes around either the setting or value.
Global system variables must be specified using the command line or SQL commands (runtime/session) or by configuration file (permanent).

- 27,586
- 18
- 84
- 94
-
how to do that in configuration file ? i opened my.ini there are no such settings :( i'm able to change in MySQL console, but all the settings gets erased after a restart – Sourav Apr 23 '11 at 05:36
-
Take a look at the documentation: http://dev.mysql.com/doc/refman/5.5/en/option-files.html – AJ. Apr 23 '11 at 11:19
-
i tried with `set sql_select_limit=5000;` and `set GLOBAL sql_select_limit=5000;` and also in the my.ini, all approach fails :( – Sourav Apr 23 '11 at 13:08
-
@Sourav - First, the keyword `set` need only be used on the command line. In your ini file, just use the format `optname=value` (without set). Second, any time you change the main server ini file, you have to restart the server for the changes to take effect. Did you do that? Verify the settings by running `phpinfo()` and check to see that your options are set correctly. – AJ. Apr 23 '11 at 18:58
I have had the same question because in WAMP we only have a my.ini
file instead of my.conf
.
Through a SQL statement, proceeded as follow:
mysql> SET global max_heap_table_size=524288000;
mysql> SET global tmp_table_size=524288000;
but when restarted the server, the query:
select @@global.tmp_table_size, @@global.max_heap_table_size
returned the old values by default.
Then edited my.ini
file ading the following statements:
max_heap_table_size=524288000
tmp_table_size=524288000
and the changes were permanent.