问题原文
原帖链接 · simonC · CC BY-SA 4.0
I am trying to enable the slow query log via RDS web console.
We are using mysql 5.6 on RDS not aurora.
I'm changing the Parameter groups values of slow_query_log to 1 long_query_time to 5 slow_query_log_file is /rdsdbdata/log/slowquery/mysql-slowquery.log
SHOW GLOBAL STATUS; shows the value of Slow_queries of 2817006 and is increasing so obviously the slow queries are present but nothing is in the log.
the downloaded log logs like
the log is created but the content of the log does not contain any sql
/rdsdbbin/mysql/bin/mysqld, Version: 5.6.34-log (MySQL Community Server (GPL)). started with:
Tcp port: 3306 Unix socket: /tmp/mysql.sock
Time Id Command Argument
/rdsdbbin/mysql/bin/mysqld, Version: 5.6.34-log (MySQL Community Server (GPL)). started with:
Tcp port: 3306 Unix socket: /tmp/mysql.sock
Time Id Command Argument
/rdsdbbin/mysql/bin/mysqld, Version: 5.6.34-log (MySQL Community Server (GPL)). started with:
Tcp port: 3306 Unix socket: /tmp/mysql.sock
Time Id Command Argument
已采纳解答
原帖链接 · sysadmin1138 · CC BY-SA 4.0
There is one parameter that need to be updated to enable the slow query log, and two that define how it works:
slow_query_log: Needs to be set to 1 to enable it.
long_query_time: Tells what long-running queries get logged.
min_examined_row_limit: If you care less about run-time and more about queries that might be table-scanning, setting this to a non-zero value will limit what gets logged to queries that touch too many rows.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
