Skip to content

Instantly share code, notes, and snippets.

@ShinJJang
Last active December 12, 2019 13:16
Show Gist options
  • Save ShinJJang/c866c71f83f7b67e9ce9c4ee3a5c819f to your computer and use it in GitHub Desktop.
Save ShinJJang/c866c71f83f7b67e9ce9c4ee3a5c819f to your computer and use it in GitHub Desktop.

mariadb audit plugin 설치

무중단이 가능합니다!

플러그인 directory에서 server_audit.so 확인

SHOW GLOBAL VARIABLES LIKE 'plugin_dir';

설치

INSTALL PLUGIN server_audit SONAME 'server_audit.so';

설치 확인

SELECT * from information_schema.plugins where plugin_name='server_audit';

변수 확인

SHOW GLOBAL VARIABLES LIKE 'server_audit%';

감시 action 정의

SET GLOBAL server_audit_events='CONNECT,QUERY,TABLE';

log file rotate 켬

SET GLOBAL server_audit_file_rotate_now = 'ON';

root 제외 (include 우선순위가 더 높음)

SET GLOBAL server_audit_excl_users = 'root';

audit 켬

SET GLOBAL server_audit_logging=on;

server_audit.log 위치 확인

SHOW GLOBAL VARIABLES LIKE 'datadir%';

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment