Changes in my.cnf not applying to audit plugin

Hello Sir,

I am trying to install percona audit plugin on rhel 7.9 server running mysql 8.0.33 community version.
After adding the variables in my.cnf and installing the audit plugin, I am not able to see the updated variables.

The audit log is generated inside the data directory.

I have tried uninstalling and reinstalling the plugin but still it’s the same.

If I add the variables and try to login to mysql it gives below error.
mysql: [ERROR] unknown variable 'audit_log_file=/abc/def/ghi/audit.log

after hashing out the variables and after restart the values I can see in show global variables is as follows.

mysql> show global variables like ‘%audit%’;
±----------------------------±--------------+
| Variable_name | Value |
±----------------------------±--------------+
| audit_log_buffer_size | 1048576 |
| audit_log_exclude_accounts | |
| audit_log_exclude_commands | |
| audit_log_exclude_databases | |
| audit_log_file | audit.log |
| audit_log_flush | OFF |
| audit_log_format | OLD |
| audit_log_handler | FILE |
| audit_log_include_accounts | |
| audit_log_include_commands | |
| audit_log_include_databases | |
| audit_log_policy | ALL |
| audit_log_rotate_on_size | 0 |
| audit_log_rotations | 0 |
| audit_log_strategy | ASYNCHRONOUS |
| audit_log_syslog_facility | LOG_USER |
| audit_log_syslog_ident | percona-audit |
| audit_log_syslog_priority | LOG_INFO |
±----------------------------±--------------+
18 rows in set (0.00 sec)

Please help as I have tried multiple times and it’s not working.

Are you adding the parameter inside [mysql] or inside [mysqld]? Configuration for the server belongs in [mysqld] section.

2 Likes

Hello Sir,

Added the parameters under [mysqld] and it worked.

Thank you so much.

1 Like