Permalink
Browse files

add slow query log

  • Loading branch information...
nakabonne committed Sep 16, 2018
1 parent 512d40f commit 916a01883ebe72977cd8adb9cd66de98aa0ed38a
Showing with 13 additions and 0 deletions.
  1. +13 −0 Makefile
@@ -6,3 +6,16 @@ SHELL = /usr/bin/env bash

restart:
sh scripts/restart.sh

set-slow-log:
sudo mysql -uisucon -pisucon -e "set global slow_query_log = 1"
sudo mysql -uisucon -pisucon -e "set global long_query_time = 0"
sudo mysql -uisucon -pisucon -e "set global log_queries_not_using_indexes = 1"
sudo mysql -uisucon -pisucon -e "set global slow_query_log_file = /var/lib/mysql/slow.log"

mysqldumpslow:
sudo mysqldumpslow -s t /var/lib/mysql/slow.log > ~/tmp/slow.log
sudo cp /dev/null /var/lib/mysql/slow.log

restart-mysql:
sudo /etc/init.d/mysql restart

0 comments on commit 916a018

Please sign in to comment.