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

前端 未结 6 1650
渐次进展
渐次进展 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:34

    Recreate:

    USE mysql;
    
    CREATE TABLE IF NOT EXISTS `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
    ) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='General log';
    

    Clear table:

    TRUNCATE table mysql.general_log;
    

提交回复
热议问题