Automatic rotation of the audit log is supported in MySQL Server 5.5.28 and later. This is achieved by adding the audit_log_rotate_on_size option to the MySQL configuration file with a value of the size when to rotate the log.
For example to rotate the log when it reached a size of 1G:
[mysqld] audit_log_rotate_on_size = 1G
The size can also be changed dynamically:
mysql> SET GLOBAL audit_log_rotate_on_size = 1024*1024*1024;
How to Manually Rotate the MySQL Enterprise Audit Log
To rotate the MySQL Enterprise Audit Log two steps are required:
1. Rename the existing audit log, for example:
$ mv audit.log audit.log.1
2. Flush the log using the audit_log_flush variable:
SET GLOBAL audit_log_flush = 1;
Privileges
As the audit_log_flush variable only exists in the GLOBAL scope, it requires the SUPER privilege to set it.
If you don’t want to grant that user the SUPER privilege (this privilege should be given sparingly) an option is to create a simple procedure that flushes the audit log and have that procedure executed with SQL SECURITY DEFINER. This way you can create the procedure with a user that has SUPER, and then grant EXECUTE on the procedure to the users who should be allowed to execute it.