Comments - Audit parameters getting reset after MySQL DB restart
Content reproduced on this site is the property of its respective owners,
and this content is not reviewed in advance by MariaDB. The views, information and opinions
expressed by this content do not necessarily represent those of MariaDB or any other party.
The variables will not persist after a restart if they are only set dynamically, and not placed in a configuration file.
Thanks. I actually figured it out. Here is the problem. If the server_audit_file_path variable points to a non-existent directory, then the server_audit_logging will not get enabled even if you set it in my.cnf. I was using Unix variables for the server_audit_file_path which apparently wer not getting expanded. Like this
server_audit_file_path=$DIRECTORY_AUD/audit.log
Further to add, I have added these parameters to my.cnf just below the [mysqld] section.
As part of this automation, I do install the Audit Plugin dynamically and then enable few server_audit parameters.
Assuming you use our RPM packages, then you can do your automation like this:
/etc/my.cnf.d/server_audit.cnfwith your server_audit parametersIf you don't use our RPM packages, you can create
/etc/my.cnf.ddirectory (or any other path you want) manually and add!includedir /etc/my.cnf.dto your/etc/my.cnf, then proceed as above.