Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can not record DDL sql #282

Open
luban-130 opened this issue Nov 20, 2024 · 2 comments
Open

can not record DDL sql #282

luban-130 opened this issue Nov 20, 2024 · 2 comments

Comments

@luban-130
Copy link

mysql version: 5.7.25
audit_plugin version: audit-plugin-mysql-5.7-1.1.7-913-linux-x86_64.zip

my.cnf:
plugin-load=AUDIT=libaudit_plugin.so
audit_json_file=on
audit_json_log_file=/home/logs/mysql/audit.log
audit_sess_connect_attrs=false
audit_record_cmds=drop,alter,update,delete

problem:
When I execute DML statements (such as update or delete), logs are recorded normally. However, when I execute DDL statements (such as alter or drop), they are not recorded in the audit logs.

audit.log
{"msg-type":"activity","date":"1732080563700","thread-id":"1337","query-id":"160","user":"root","priv_user":"root","ip":"1.202.237.155","host":"1.202.237.155","rows":"1","status":"0","cmd":"update","objects":[{"db":"zdgs-cloud","name":"xinxi2","obj_type":"TABLE"}],"query":"/* ApplicationName=DBeaver 24.2.4 - Main / UPDATE zdgs-cloud.xinxi2\n\tSET xuehao='4',id=4\n\tWHERE id=3"}
{"msg-type":"activity","date":"1732080586021","thread-id":"1337","query-id":"165","user":"root","priv_user":"root","ip":"1.202.237.155","host":"1.202.237.155","rows":"1","status":"0","cmd":"delete","objects":[{"db":"zdgs-cloud","name":"xinxi2","obj_type":"TABLE"}],"query":"/
ApplicationName=DBeaver 24.2.4 - Main */ DELETE FROM zdgs-cloud.xinxi2\n\tWHERE id=4"}

@luban-130
Copy link
Author

After upgrading the MySQL version from 5.7.25 to 5.7.38 and the audit version from 1.1.7 to 1.1.13 in the testing environment, the issue persists: only DML execution records are present in the audit logs, but no DDL execution records. Is there a problem with the parameter configuration in the my.cnf file?

@luban-130
Copy link
Author

luban-130 commented Nov 20, 2024

Uploading audit.png…
When I commented out the configuration item audit_record_cmds=drop,alter,update,delete in the configuration file, DDL statements started being recorded. Why is that?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant