I dropped general_log table, how do I create it again?

前端 未结 6 1652
渐次进展
渐次进展 2021-01-31 06:16

Logging enabled

I enabled logging using:

SET GLOBAL log_output = \'TABLE\';
SET GLOBAL general_log = \'ON\';

All executed queries was lo

6条回答
  •  日久生厌
    2021-01-31 06:44

    For 1.:

    USE mysql;
    CREATE TABLE `general_log` (
        `event_time` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
        `user_host` MEDIUMTEXT NOT NULL,
        `thread_id` INT(11) NOT NULL,
        `server_id` INT(10) UNSIGNED NOT NULL,
        `command_type` VARCHAR(64) NOT NULL,
        `argument` MEDIUMTEXT NOT NULL
    )
    COMMENT='General log'
    COLLATE='utf8_general_ci'
    ENGINE=CSV;
    

    For 2.:

    TRUNCATE mysql.general_log;
    

提交回复
热议问题