Last active
March 2, 2020 15:47
-
-
Save daniDLL/66eb31ae5a66e8808275975b43b25cff to your computer and use it in GitHub Desktop.
Show executed queries in real time
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Show real-time | |
watch -n1 'mysql -u root -ppassword --execute="SHOW FULL PROCESSLIST"' | |
## Show real-time and pipe all info to file | |
watch -t -n1 '(mysql -h dbhost -u dbuser dbname -ppassword --execute="SHOW FULL PROCESSLIST") | tee -a mysql-process-list.log' | |
## Show slow queries real-time and pipe all info to file | |
watch -t -n1 '(mysql -h dbhost -u dbuser dbname -ppassword --execute="SELECT * FROM information_schema.processlist WHERE TIME > 5 ORDER BY TIME DESC") | tee -a /tmp/mysql-process-list.log' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment