I wanted to delete old rows from my mysql.general_log
table but ran into this error:
#1556 - You can't use locks with log tables.
This is the query I ran:
DELETE FROM `general_log` WHERE `event_time` < "2014-01-25 14:05"
I wanted to delete old rows from my mysql.general_log
table but ran into this error:
#1556 - You can't use locks with log tables.
This is the query I ran:
DELETE FROM `general_log` WHERE `event_time` < "2014-01-25 14:05"
You can rename the table, perform the cleaning as needed, then revert the table name again.
Example:
SET GLOBAL general_log = 'OFF';
RENAME TABLE general_log TO general_log_temp;
DELETE FROM `general_log_temp` WHERE `event_time` < DATE(NOW());
RENAME TABLE general_log_temp TO general_log;
SET GLOBAL general_log = 'ON';