job/mysql
ERROR 1238 (HY000): Variable 'log_slow_queries' is a read only variable
시스템엔지니어
2018. 8. 31. 16:35
mysql> set global log_slow_queries = ON;
ERROR 1238 (HY000): Variable 'log_slow_queries' is a read only variable
####공식홈페이지 설명#######
One way around this is to setup the machine with the Slow Query Log
enabled but to use a very large value of --long-query-time to
essentially ignore every query. Then, when you want to capture slow
queries, you reset --long-query-time to a reasonable value.
Unfortunately, this requires a restart to initialize. After that you can
adjust the --long-query-time to throttle the contents of the log.
mysql5.0 버전까지는 재시작없이는 설정이 안된단다. my.cnf에 등록하고 db 재시작해야한다. 5.1부터는 재시작없이 설정가능