大网数据广告活动
服务器运维问答

Amazon RDS mysql enable slow querry log

· 52CE 我爱测

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/sl…

问题原文

原帖链接 · 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.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2018-11-06)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。