Comments - Audit parameters getting reset after MySQL DB restart

 
8 years, 6 months ago Ian Gilfillan

The variables will not persist after a restart if they are only set dynamically, and not placed in a configuration file.

 
8 years, 6 months ago Sanjay Kumar Raghavendra

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

 
8 years, 6 months ago Sanjay Kumar Raghavendra

Further to add, I have added these parameters to my.cnf just below the [mysqld] section.

 
8 years, 6 months ago Sanjay Kumar Raghavendra

As part of this automation, I do install the Audit Plugin dynamically and then enable few server_audit parameters.

 
8 years, 6 months ago Sergei Golubchik

Assuming you use our RPM packages, then you can do your automation like this:

  1. start the server
  2. create /etc/my.cnf.d/server_audit.cnf with your server_audit parameters
  3. install the audit plugin dynamically — it will read parameters from the file all right, you won't need to configure them run-time.

If you don't use our RPM packages, you can create /etc/my.cnf.d directory (or any other path you want) manually and add !includedir /etc/my.cnf.d to your /etc/my.cnf, then proceed as above.

 
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.