saving MySQL settings

半腔热情 提交于 2019-12-19 03:07:54

问题


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'.

  1. Edit your my.ini file and under the [mysqld] section, add this:

    setting-name=setting-value , example: event-scheduler=on

  2. restart 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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!