The general query log is a general record of what mysqld is doing.
The server writes information to this log when clients connect or
disconnect, and it logs each SQL statement received from clients.
Create General log table.
CREATE TABLE mysql.general_log (
event_time timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
user_host mediumtext NOT NULL,
thread_id bigint(21) UNSIGNED NOT NULL,
server_id int(10) UNSIGNED NOT NULL,
command_type varchar(64) NOT NULL,
argument mediumtext NOT NULL
)
SHOW CREATE TABLE mysql.general_log;
On/Off General_log.
SET GLOBAL general_log = 'OFF';
SET GLOBAL general_log = 'ON';
Change output type.
SET GLOBAL log_output = 'TABLE';
View log Examples:
SELECT * FROM mysql.general_log ORDER BY event_time DESC
Result:
Truncate general log.
TRUNCATE mysql.general_log;
0 Comments