formatuu 发表于 2018-10-8 07:51:26

MySQL audit—SQL审计插件

# unzip audit-plugin-mysql-5.6-1.1.4-725-linux-x86_64.zip  
# cd audit-plugin-mysql-5.6-1.1.4-725
  
#先进下MySQL中看下插件所在的路径
  
mysql> show variables like '%plugin_dir%';
  
+---------------+------------------------------+
  
| Variable_name | Value                        |
  
+---------------+------------------------------+
  
| plugin_dir    | /usr/local/mysql/lib/plugin/ |
  
+---------------+------------------------------+
  
1 row in set (0.03 sec)
  

  
# cp lib/libaudit_plugin.so /usr/local/mysql/lib/plugin/
  
# cd /usr/local/mysql/lib/plugin
  
# chown mysql:mysql libaudit_plugin.so && chmod +x libaudit_plugin.so
  
#修改插件的属组和添加权限
  
# mysql#再进MySQL中安装插件
  
mysql> install plugin audit soname 'libaudit_plugin.so';
  
mysql> show global variables like 'audit%';
  
mysql> set global audit_json_file = on;
  
# cd utils/
  
# chmod +x offset-extract.sh
  
# ./offset-extract.sh /usr/local/mysql/bin/mysqld#初始化
  
//offsets for: /usr/local/mysql/bin/mysqld (5.6.35)
  
{"5.6.35","c48fe13e444883af96c7f134cd0c952b", 6992, 7040, 4000, 4520, 72, 2704, 96, 0, 32, 104, 136, 7128, 4392, 2800, 2808, 2812, 536, 0, 0, 6360, 6384, 6368},


页: [1]
查看完整版本: MySQL audit—SQL审计插件