LoginSignup
1

More than 5 years have passed since last update.

mysql5.7 slow query解析の注意点

Last updated at Posted at 2016-10-21

mysql5.7で,なぜかmysqldumpslowがうまく動いてくれなかった.
具体的には,中身が同じクエリを,別々にカウントしていた.

原因はmysql5.7から追加されたlog_timestampsというオプション(だと思う)

デフォルトでこのオプションの値がUTCとなっており,mysqldumpslowがそれに対応しておらず別々にカウントしていたらしい

なので
my.cnfで

log_timestamps = SYSTEM

として再起動するか
consoleで

set global log_timestamps = SYSTEM;

として

mysqldumpslow -s t /tmp/mysql-slow.log

などとしてやればよい.

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1