grousso icon

Log every SQL query to a log file really easily

grousso | PRO | 07/03/19 02:07:22 PM UTC | 0 ⭐ | 289 👁️ | Never ⏰ | []
text |

640 B

|

None

|

0 👍

/

0 👎

You can log every query to a log file really easily:
 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';
Do your queries (on any db). Grep or otherwise examine /var/run/mysqld/mysqld.log
 Then don't forget to
 mysql> SET GLOBAL general_log = 'OFF';
  or the performance will plummet and your disk will fill!

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎