The first step is to create the following two log tables
Press CTRL + C to copy the code<textarea></textarea>Press CTRL + C to copy the code
CREATE TABLE ' General_log ' ( ' event_time ' timestamp not NULL DEFAULT current_timestamp on UPDATE Current_ TIMESTAMP, ' user_host ' mediumtext not NULL, ' thread_id ' bigint (+) unsigned not null, ' server_id ' int (10) unsigned not NULL, ' command_type ' varchar ($) NOT null, ' argument ' mediumtext not null ) Engine=csv DEFAULT Charset=utf8 comment= ' General log '
The second step is to open the query log on the database
SET Global general_log = 1; SET Global log_output = ' table ';
Step three query log
SELECT * FROM Mysql.general_log
Step fourth closes the query log on the database
SET global general_log = 0;
Fifth step clear the database log
TRUNCATE TABLE Mysql.general_log;
http://blog.csdn.net/testcs_dn/article/details/18791815
MySQL Event Tracker, MySQL does not need to restart the service tracking SQL, or configure the log