Remove data from General_log in AWS RDS for Mariadb or Mysql

General_log truncate the table in AWS RDS

If general_log = 1 and log_output = TABLE then it start filling the mysql.general_log table.

In AWS Environment, its doesnot provide any way to truncate the table. you can rotate the table data by executing one AWS package which will put the general_log data to general_log_backup table and Empty the general_log_Backup table if it already has data.

Connect with mysql or mariadb prompt and execute it:

CALL mysql.rds_rotate_general_log; 

For completely remove the data and release space, execute the procedure two times:

CALL mysql.rds_rotate_general_log; 
CALL mysql.rds_rotate_general_log; 

For slow query parameter (slow_query_log = 1), To empty the mysql.slow_log we will use the following :

CALL mysql.rds_rotate_slow_log;

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.