# How to rotate audit log manually with audit\_log plugin in Percona MySQL 8.0.20?

**URL:** <https://forums.percona.com/t/how-to-rotate-audit-log-manually-with-audit-log-plugin-in-percona-mysql-8-0-20/9429>\
**Category:** MySQL & MariaDB\
**Tags:** mysql\
**Created:** [February 25, 2021, 8:11pm UTC](https://forums.percona.com/t/how-to-rotate-audit-log-manually-with-audit-log-plugin-in-percona-mysql-8-0-20/9429 "2021-02-25T20:11:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lokesh123](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/lokesh123/32/5519_2.png) [@lokesh123](https://forums.percona.com/u/lokesh123)\
**Post date:** [February 25, 2021, 8:11pm UTC](https://forums.percona.com/t/how-to-rotate-audit-log-manually-with-audit-log-plugin-in-percona-mysql-8-0-20/9429/1 "2021-02-25T20:11:32Z")

</div>

Percona Audit log variable audit\_log\_flush not working.

set global audit\_log\_flush=1;

I want to rotate logs manually but it did not do anything ?

---

<div class="post-metadata">

**Author:** ![Ivan\_Groenewold](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/ivan_groenewold/32/6299_2.png) [@Ivan\_Groenewold](https://forums.percona.com/u/Ivan_Groenewold)\
**Post date:** [March 10, 2021, 11:35am UTC](https://forums.percona.com/t/how-to-rotate-audit-log-manually-with-audit-log-plugin-in-percona-mysql-8-0-20/9429/2 "2021-03-10T11:35:01Z")

</div>

> [@lokesh123](#):
>
> audit\_log\_flush

Hi, the parameter will close the log file and then reopen it, so the way to do it is:

1. Move the existing file e.g.  
mv audit.log audit.log.2020103

2. Flush  
set global audit\_log\_flush=1;

This will cause a new file to be created.

---

<div class="post-metadata">

**Author:** ![lokesh123](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/lokesh123/32/5519_2.png) [@lokesh123](https://forums.percona.com/u/lokesh123)\
**Post date:** [March 10, 2021, 12:02pm UTC](https://forums.percona.com/t/how-to-rotate-audit-log-manually-with-audit-log-plugin-in-percona-mysql-8-0-20/9429/3 "2021-03-10T12:02:34Z")

</div>

@Ivan_Groenewold I have done the same It works.

Thank you for your Response.

---

<div class="post-metadata">

**Author:** ![Ivan\_Groenewold](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/ivan_groenewold/32/6299_2.png) [@Ivan\_Groenewold](https://forums.percona.com/u/Ivan_Groenewold)\
**Post date:** [March 10, 2021, 2:54pm UTC](https://forums.percona.com/t/how-to-rotate-audit-log-manually-with-audit-log-plugin-in-percona-mysql-8-0-20/9429/4 "2021-03-10T14:54:03Z")

</div>

glad to hear! let us know if you need further help
