问题
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,
回答1:
Drive:\wamp\bin\mysql\mysql5.5.8\my.ini
this is the place to save settings.
回答2:
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.
回答3:
Global system variables must be specified using the command line or SQL commands (runtime/session) or by configuration file (permanent).
回答4:
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.
来源:https://stackoverflow.com/questions/5755696/saving-mysql-settings