Skip to content

Instantly share code, notes, and snippets.

@Exadra37
Created June 7, 2016 13:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Exadra37/d93e4f1b1918772d689799b27e1a17c9 to your computer and use it in GitHub Desktop.
Save Exadra37/d93e4f1b1918772d689799b27e1a17c9 to your computer and use it in GitHub Desktop.
Watch Mysql queries in real time
$> tail -f -n 100 /var/lib/mysql/devint1.log
...
8941 Prepare select * from `stepFeed` where `productId` = ? limit 1
8941 Execute select * from `stepFeed` where `productId` = '764773' limit 1
mysql> SHOW VARIABLES LIKE "general_log%";
+------------------+----------------------------+
| Variable_name | Value |
+------------------+----------------------------+
| general_log | OFF |
| general_log_file | /var/lib/mysql/devint1.log |
+------------------+----------------------------+
2 rows in set (0.00 sec)
mysql> SET GLOBAL general_log = 'ON';
Query OK, 0 rows affected (0.00 sec)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment