mysql查询正在执行的sql

mysql> SHOW VARIABLES LIKE "general_log%";

+------------------+----------------------------+
| Variable_name | Value |
+------------------+----------------------------+
| general_log | OFF |
| general_log_file | /var/run/mysqld/mysqld.log |
+------------------+----------------------------+

mysql> SET GLOBAL general_log = 'ON';

Then don't forget to

mysql> SET GLOBAL general_log = 'OFF';

from: https://stackoverflow.com/a/7470567/8025086

原文地址:https://www.cnblogs.com/buxizhizhoum/p/10742842.html