Search code examples
mysqlcentosupgradegeneral-log

ERROR 1146 (42S02): Table 'mysql.general_log' doesn't exist


After mysql upgrade I'm getting this error on my Centos box when I tried to enable general_log. Any idea?

SET GLOBAL general_log = 'ON';

ERROR 1146 (42S02) : Table 'mysql.general_log' doesn't exist


Solution

  • I have created that missing table and worked for me.

    Login to mysql console

    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
    ) ENGINE=CSV DEFAULT CHARSET=utf8 COMMENT='General log'