# enable general log (assumes "loadtest-edx-mysql56-1.11-with-query-log" is the name of the parameter group)
rds-modify-db-parameter-group loadtest-edx-mysql56-1.11-with-query-log --parameters "name=general_log,value=ON,method=immediate"
# retrieve general log
echossh 'select * from mysql.general_log' | ssh pwnage101@tools-t tools-gp.edx.org "mysql -u -user=read_only -h "-host=<hostname_of_db>" >output -p --execute='select * from mysql.general_log;'" >query_log.csv
# retrieve binlog (must be root user)
first_binlog=$(ssh -t tools-gp.edx.org "mysql -u -user=root --h "host=<hostname_of_db>" -ep --execute='show binary logs;' --skip-column-names" | head -n 1)
ssh tools-gp.edx.org "mysqlbinlog --raw --result-file=/tmp/binlogs/ --read-from-remote-server --to-last-log -u -user=root -h -host="<hostname_of_db>" -p "$first_binlog"
# view binlog locally
scp -r tools-gp.edx.org:/tmp/binlogs .
mysqlbinlog binlogs/*
|