There is no built-in support in MySQL for purging the audit log, so it is necessary to implement the purging yourself. The steps are:
1. Ensure the audit logs are rotated. You can either use an automatic rotation on size or manually purge at regular intervals:
2. Use cron or another means of scheduling a recurring event in the operating system and use that to delete the audit logs that should be purged. For example if you are using Linux and want to delete all audit logs at least four days old, you can use the find utility like:
# find /var/lib/mysql/ -maxdepth 1 -name 'audit.log.*.xml' -mtime +3 -delete
assuming the audit logs are stored on /var/lib/mysql – otherwise replace the path.
Note: Consider archiving the old audit logs on a different hos before deleting them. The audit logs will in general also compress very well.