【2016年12月4日】
忙了好几天,没来得及看书,但总要交点货吧!!
最近老板要审计,服务器压力很大,过去的mysql内部的审计早就关闭了,硬件审计又没上,贺大神推荐写到磁盘文件里.
1.在maridb官网下载插件,上传到mysql服务器,解压https://mariadb.com/kb/en/mariadb/mariadb-audit-plugin/
2.登录mysqlroot@localhost [(none)]>SHOW VARIABLES LIKE 'plugin_dir';
+---------------+------------------------------+
| Variable_name | Value |
+---------------+------------------------------+
| plugin_dir | /usr/local/mysql/lib/plugin/ |
+---------------+------------------------------+
1 row in set (0.01 sec)
3.把插件拷贝到plugindir目录下,在mysql中安装:INSTALL PLUGIN server_audit SONAME 'server_audit.so;
set global server_audit_events='query_ddl,query_dml';
set global server_audit_logging = 1;