- install spdlog
- put
audit_connection
tomysql_source_code/plugin
- e.g. /root/mysql-8.0.29/plugin/audit_connection
- compile mysql as usual
- after compiling, put
plugin_output_directory/audit_connection.so
in<mysql_base_dir>/lib/plugin
- place the following configuration in the
[mysqld]
section of/etc/my.cnf
plugin-load-add=audit_connection.so
audit_connection=FORCE_PLUS_PERMANENT
- <data_dir>/audit_connection.log;
- 50MB per log file;
- keep 7 files;