SHOW VARIABLES LIKE 'plugin_dir';
show plugins;
show global variables like "server_audit%";
install plugin server_audit soname 'server_audit.so';
set global server_audit_logging=ON;
# vi /usr/local/mysql/my.cnf
~(생략)
[mysqld]
~(생략)
server_audit_output_type = syslog
server_audit_syslog_ident = mysql
server_audit_excl_users = 'root'
server_audit_logging = 1
https://lefred.be/content/poormans-mysql-table-audit-information/
JSON?
MySQL 은 Percona의 plugin을 복사 필요
$ wget https://downloads.percona.com/downloads/Percona-Server-8.0/Percona-Server-8.0.26-16/binary/tarball/Percona-Server-8.0.26-16-Linux.x86_64.glibc2.12.tar.gz
$ tar xvfz Percona-Server-8.0.26-16-Linux.x86_64.glibc2.12.tar.gz
$ cd Percona-Server-8.0.26-16-Linux.x86_64.glibc2.12/lib/plugin
$ dockr cp audit_log.so mysql:/usr/lib64/mysql/plugin
안되서 mariadb의 server_audit.so 카피
참고