砂拉豆 发表于 2018-10-10 09:49:54

Mysql通用日志总结

mysql> set global log_output='file,table';Query OK, 0 rows affected (0.00 sec)  
mysql> select @@global.log_output;+---------------------+| @@global.log_output |+---------------------+| FILE,TABLE          |+---------------------+1 row in set (0.00 sec)
  
mysql> select thread_id,command_type,argument,event_time from mysql.general_log;+-----------+--------------+--------------------------------------------------------------------------+----------------------------+| thread_id | command_type | argument                                                               | event_time               |+-----------+--------------+--------------------------------------------------------------------------+----------------------------+|       136 | Query      | select * from mysql.slow_log                                             | 2016-11-25 17:17:44.237846 ||       136 | Query      | desc mysql.general_log                                                   | 2016-11-25 17:19:05.909411 ||       136 | Query      | select thread_id,command_type,argument,event_time from mysql.general_log | 2016-11-25 17:19:50.188954 ||       136 | Query      | show variables like 'log_output'                                       | 2016-11-25 17:23:21.393370 ||       136 | Query      | set global log_output='file,table'                                       | 2016-11-25 17:23:41.443710 ||       136 | Query      | select @@global.log_output                                             | 2016-11-25 17:23:54.132140 ||       136 | Query      | select thread_id,command_type,argument,event_time from mysql.general_log | 2016-11-25 17:24:08.725540 |+-----------+--------------+--------------------------------------------------------------------------+----------------------------+7 rows in set (0.00 sec)
  
mysql> commit;Query OK, 0 rows affected (0.00 sec)


页: [1]
查看完整版本: Mysql通用日志总结