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

前端 未结 6 1653
渐次进展
渐次进展 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条回答
  •  梦毁少年i
    2021-01-31 06:25

    MySQL 5.7.18

    I have dropped the mysql.general_log table too, but the other answers did not help me.

    Then, I noticed errors about the table structure cause it's a bit different on MySQL 5.7.18, so I have changed some field and now it works.

    In case anybody needs it:

    CREATE TABLE `general_log` (
      `event_time` timestamp(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6),
      `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` mediumblob
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='General log'
    

提交回复
热议问题