1. 程式人生 > 資料庫 >mysql的sql語句日誌記錄

mysql的sql語句日誌記錄

mysql的sql語句日誌記錄

SET GLOBAL log_output = ‘TABLE’;SET GLOBAL general_log = ‘ON’;
SET GLOBAL log_output = ‘TABLE’;SET GLOBAL general_log = ‘off’;

SELECT * from mysql.general_log ORDER BY event_time DESC;

truncate table mysql.general_log;