سؤال

My prod_server version is 5.1.47 and want to set the slow query log dynamically for certain period of time. I refered one site(http://toastergremlin.com/?p=276) there is mentioned below 5.1.6 we need to set the variables into the my.cnf, but my prod_server is critical can't take my server restart is there any way we set variables dynamically for certain period of time?

Thank u in advance please help.

هل كانت مفيدة؟

المحلول

You can set any global variables to any value on the fly using below statement in MySQL prompt:

set global <variable> = <value>;

In your case use the following to turn on slow query log:

 set global slow_query_log=1;

By default the "slow wait time" is set to 10 sec, but you can change it as well.

Hope it helps.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى dba.stackexchange
scroll top