# Audit log can't log 'db' information

**URL:** <https://forums.percona.com/t/audit-log-cant-log-db-information/22659>\
**Category:** Other MySQL® Questions\
**Created:** [June 8, 2023, 7:36am UTC](https://forums.percona.com/t/audit-log-cant-log-db-information/22659 "2023-06-08T07:36:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![spihiker](https://avatars.discourse-cdn.com/v4/letter/s/f04885/32.png) [@spihiker](https://forums.percona.com/u/spihiker)\
**Post date:** [June 8, 2023, 7:36am UTC](https://forums.percona.com/t/audit-log-cant-log-db-information/22659/1 "2023-06-08T07:36:26Z")

</div>

Hi:  
After install audit\_log plugin,all work well but database information can’t log.  
thanks for you help.

eg:  
{“audit\_record”:{“name”:“Query”,“record”:“4894\_2023-06-08T06:38:10”,“timestamp”:“2023-06-08T07:04:53Z”,“command\_class”:“update”,“connection\_id”:“19”,“status”:0,“sqltext”:“update tt set c4=‘bb’ where c1=2”,“user”:“dba[dba] @ [192.168.1.10]”,“host”:“”,“os\_user”:“”,“ip”:“192.168.1.10”,“db”:“”

---

<div class="post-metadata">

**Author:** ![CTutte](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/ctutte/32/1341_2.png) [@CTutte](https://forums.percona.com/u/CTutte)\
**Post date:** [June 8, 2023, 12:19pm UTC](https://forums.percona.com/t/audit-log-cant-log-db-information/22659/2 "2023-06-08T12:19:20Z")

</div>

Hi spihiker,

Could you please further explain what do you mean by “all work well but database information can’t log.” ?

I.e is the audit plugin not working at all? Is it not working for some stuff or under some cases?  
By the way , make sure you are not using audit “Exclude” commands as shown in the official doc: [Audit log plugin - Percona Server for MySQL](https://docs.percona.com/percona-server/8.0/management/audit_log_plugin.html#install-the-plugin) . I.e:  
audit\_log\_exclude\_{account, command, database}. If using this filter then some of the information might not be audited

---

<div class="post-metadata">

**Author:** ![spihiker](https://avatars.discourse-cdn.com/v4/letter/s/f04885/32.png) [@spihiker](https://forums.percona.com/u/spihiker)\
**Post date:** [June 9, 2023, 1:18am UTC](https://forums.percona.com/t/audit-log-cant-log-db-information/22659/3 "2023-06-09T01:18:36Z")

</div>

Hi CTutte，  
Audit plugin can work well .but the value of “db” parameter in the audit log is always NULL.Please see the end of following log.

{“audit\_record”:{“name”:“Query”,“record”:“4917\_2023-06-08T06:38:10”,“timestamp”:“2023-06-08T09:17:24Z”,“command\_class”:“delete”,“connection\_id”:“27”,“status”:0,“sqltext”:“delete from user where uid=1”,“user”:“test[test] @ [192.168.1.10]”,“host”:“”,“os\_user”:“”,“ip”:“192.168.1.10”,“db”:“”}}

```
Thank you .

```

---

<div class="post-metadata">

**Author:** ![spihiker](https://avatars.discourse-cdn.com/v4/letter/s/f04885/32.png) [@spihiker](https://forums.percona.com/u/spihiker)\
**Post date:** [June 9, 2023, 1:54am UTC](https://forums.percona.com/t/audit-log-cant-log-db-information/22659/4 "2023-06-09T01:54:04Z")

</div>

Hi CTutte,  
I know why. Connection problem.  
I use mysql clinet to operate the database.When establishing a connection, add “–database” parameter,It’s ok.That’s all.  
Thank you again.Have a nice weekend.
