MySQL5.5 安装mcafee mysql-audit插件 不成功

主页:https://github.com/mcafee/mysql-audit/wiki

各版本安装包:https://bintray.com/mcafee/mysql-audit-plugin/release

安装步骤还是比较简单的,只有几步:

1)查看插件目录

mysql> SHOW GLOBAL VARIABLES LIKE ‘plugin_dir‘;

+---------------+--------------------+
| Variable_name | Value              |
+---------------+--------------------+
| plugin_dir    | /mysql/lib/plugin/ |
+---------------+--------------------+
1 row in set (0.00 sec)

2)复制下载的so文件至plugin_dir

3)安装插件,不报错即为成功

mysql> INSTALL PLUGIN AUDIT SONAME ‘libaudit_plugin.so‘;

4)可以查看安装的版本

mysql> SHOW GLOBAL STATUS LIKE ‘AUDIT_version‘;

5)开启审计

mysql> SET GLOBAL audit_json_file=ON;

问题是,在第三步安装插件时总是不成功,报错

mysql> INSTALL PLUGIN AUDIT SONAME ‘libaudit_plugin.so‘;
ERROR 1123 (HY000): Can‘t initialize function ‘AUDIT‘; Plugin initialization function failed.

查看错误日志,注意到offsets_by_version: 1,即为打开Offsets检验,但提示Offsets检验失败

140917 18:04:02 [Note] Audit Plugin: setup_offsets audit_offsets: (null) validate_checksum: 1 offsets_by_version: 1
140917 18:04:03 [Note] Audit Plugin: mysqld: /mysql/bin/mysqld (325edbcbbfaabdddd7b22e3036c2d774)
140917 18:04:03 [ERROR] Audit Plugin: Offsets: 5.5.21 (4a03ad064ed393dabdde175f3ea05ff2) match thread validation check fails with value: 0. Skipping offest.
140917 18:04:03 [ERROR] Audit Plugin: Offsets: 5.5.21 (4a03ad064ed393dabdde175f3ea05ff2) match thread validation check fails with value: 0. Skipping offest.
140917 18:04:03 [ERROR] Audit Plugin: Offsets: 5.5.21-55 (e4f1b39e9dca4edc51b8eb6aa09e2fa4) match thread validation check fails with value: 0. Skipping offest.
140917 18:04:03 [ERROR] Audit Plugin: Offsets: 5.5.21-55 (e4f1b39e9dca4edc51b8eb6aa09e2fa4) match thread validation check fails with value: 0. Skipping offest.
140917 18:04:03 [ERROR] Audit Plugin: Offsets: 5.5.21 (66d23cb577e2bcfe29da08833f5e7d8b) match thread validation check fails with value: 0. Skipping offest.
140917 18:04:03 [ERROR] Audit Plugin: Offsets: 5.5.21 (66d23cb577e2bcfe29da08833f5e7d8b) match thread validation check fails with value: 0. Skipping offest.
140917 18:04:03 [ERROR] Audit Plugin: Offsets: 5.5.21-rel25.0 (346a87d97dbf5d7aad3a9f7f707f9477) match thread validation check fails with value: 0. Skipping offest.
140917 18:04:03 [ERROR] Audit Plugin: Offsets: 5.5.21-rel25.0 (346a87d97dbf5d7aad3a9f7f707f9477) match thread validation check fails with value: 0. Skipping offest.
140917 18:04:03 [Note] Audit Plugin: Couldn‘t find proper THD offsets for: 5.5.21-log
140917 18:04:03 [ERROR] Plugin ‘AUDIT‘ init function returned error.
140917 18:04:03 [Note] Audit Plugin: deinit

关闭audit_offsets_by_version后再试试,将audit_offsets_by_version=OFF写入/etc/my.cnf,重启数据库,再安装插件,仍然报错

140917 18:11:02 [Note] Audit Plugin: setup_offsets audit_offsets: (null) validate_checksum: 1 offsets_by_version: 0
140917 18:11:02 [Note] Audit Plugin: mysqld: /mysql/bin/mysqld (325edbcbbfaabdddd7b22e3036c2d774)
140917 18:11:02 [Note] Audit Plugin: Couldn‘t find proper THD offsets for: 5.5.21-log
140917 18:11:02 [ERROR] Plugin ‘AUDIT‘ init function returned error.
140917 18:11:02 [Note] Audit Plugin: deinit
140917 18:11:42 [Note] Start binlog_dump to slave_server(1204), pos(mysql-bin.000011, 107)
140917 18:11:48 [Note] Audit Plugin: Set interface version to: 12933376 (50521)
140917 18:11:48 [Note] Audit Plugin: starting up. Version: 1.0.5 , Revision: 479 (64bit). AUDIT plugin interface version: 50521 (0xc559). MySQL Server versi
on: 5.5.21-log.
140917 18:11:48 [Note] Audit Plugin: setup_offsets audit_offsets: (null) validate_checksum: 1 offsets_by_version: 0
140917 18:11:48 [Note] Audit Plugin: mysqld: /mysql/bin/mysqld (325edbcbbfaabdddd7b22e3036c2d774)
140917 18:11:48 [Note] Audit Plugin: Couldn‘t find proper THD offsets for: 5.5.21-log
140917 18:11:48 [ERROR] Plugin ‘AUDIT‘ init function returned error.
140917 18:11:48 [Note] Audit Plugin: deinit

都是跟offsets有关,那就按照https://github.com/mcafee/mysql-audit/wiki/Troubleshooting
所写,获取本机上mysql版本对应的offsets后,写入my.cnf试试

下载offset计算脚本 https://raw.github.com/mcafee/mysql-audit/master/offset-extract/offset-extract.sh

由于我的是percona server,另外需要指明mysqld.debug路径来计算,可能还需要mysqld-debug.debug

# ./offset-extract.sh /mysql/bin/mysqld /usr/lib/debug/usr/sbin/mysqld.debug
//offsets for: /mysql/bin/mysqld (5.5.21-log)
{"5.5.21","325edbcbbfaabdddd7b22e3036c2d774", 6584, 6632, 4120, 4632, 104, 2608, 96, 0, 32, 104},
# ./offset-extract.sh /mysql/bin/mysqld /usr/lib/debug/usr/sbin/mysqld-debug.debug
//offsets for: /mysql/bin/mysqld (5.5.21-log)
{"5.5.21","325edbcbbfaabdddd7b22e3036c2d774", 6608, 6656, 4136, 4656, 104, 2608, 96, 0, 32, 104},

加入my.cnf的插件参数:

plugin-load=AUDIT=libaudit_plugin.so
audit_json_file=1
audit_json_socket_name=/mysql/data/audit.sock
audit_json_socket=OFF
audit_json_file=ON
audit_json_log_file=/mysql/data/audit.log
audit_record_cmds=connect,update,delete
audit_validate_checksum=OFF
audit_offsets=6608, 6656, 4136, 4656, 104, 2608, 96, 0, 32, 104

mysqld.debug和mysqld-debug.debug的offsets我都加入my.cnf试了下,仍然报错,崩溃!

140917 15:38:26 [Note] Audit Plugin: starting up. Version: 1.0.5 , Revision: 479 (64bit). AUDIT plugin interface version: 50521 (0xc559). MySQL Server versi
on: 5.5.21-log.
140917 15:38:26 [Note] Audit Plugin: setup_offsets audit_offsets: 6608, 6656, 4136, 4656, 104, 2608, 96, 0, 32, 104 validate_checksum: 0 offsets_by_version:
 1
140917 15:38:26 [Note] Audit Plugin: mysqld: /mysql/bin/mysqld (325edbcbbfaabdddd7b22e3036c2d774)
140917 15:38:26 [Note] Audit Plugin: setup_offsets Audit_formatter::thd_offsets values: 6608 6656 4136 4656 104 2608 96 0 32 104
140917 15:38:26 [ERROR] Audit Plugin: Offsets: (null) ((null)) match thread validation check fails with value: 0. Skipping offest.
140917 15:38:26 [ERROR] Audit Plugin: Offsets set didn‘t pass validation. audit_offsets: 6608, 6656, 4136, 4656, 104, 2608, 96, 0, 32, 104 .
140917 15:38:26 [ERROR] Plugin ‘AUDIT‘ init function returned error.
140917 15:38:26 [Note] Audit Plugin: deinit
140917 15:38:26 [Warning] ‘proxies_priv‘ entry ‘@ [email protected]‘ ignored in --skip-name-resolve mode.
140917 15:38:26 [Note] Event Scheduler: Loaded 0 events
140917 15:38:26 [Note] /mysql/bin/mysqld: ready for connections.
Version: ‘5.5.21-log‘  socket: ‘/mysql/mysqld.sock‘  port: 3306  Source distribution
140917 15:38:39 [Note] Audit Plugin: Set interface version to: 12933376 (50521)
140917 15:38:39 [Note] Audit Plugin: starting up. Version: 1.0.5 , Revision: 479 (64bit). AUDIT plugin interface version: 50521 (0xc559). MySQL Server versi
on: 5.5.21-log.
140917 15:38:39 [Note] Audit Plugin: setup_offsets audit_offsets: 6608, 6656, 4136, 4656, 104, 2608, 96, 0, 32, 104 validate_checksum: 0 offsets_by_version:
 1
140917 15:38:39 [Note] Audit Plugin: mysqld: /mysql/bin/mysqld (325edbcbbfaabdddd7b22e3036c2d774)
140917 15:38:39 [Note] Audit Plugin: setup_offsets Audit_formatter::thd_offsets values: 6608 6656 4136 4656 104 2608 96 0 32 104
140917 15:38:39 [ERROR] Audit Plugin: Offsets: (null) ((null)) match thread validation check fails with value: 0. Skipping offest.
140917 15:38:39 [ERROR] Audit Plugin: Offsets set didn‘t pass validation. audit_offsets: 6608, 6656, 4136, 4656, 104, 2608, 96, 0, 32, 104 .
140917 15:38:39 [ERROR] Plugin ‘AUDIT‘ init function returned error.
140917 15:38:39 [Note] Audit Plugin: deinit

问题出在哪儿呢,该怎么配置呢?这里先记一笔!

时间: 2024-10-16 14:46:11

MySQL5.5 安装mcafee mysql-audit插件 不成功的相关文章

MySQL audit—SQL审计插件

自从MySQL5.6出现以来开始对json的支持后,使得在MySQL上增加了一些新特性,为此这一点让MySQL增加了一些新的插件支持,在这里就说一说MySQL的SQL审计插件,SQL审计插件并不是MySQL官方的,它是由macfee公司基于percona开发的,所以,在添加SQL审计的插件功能时需要去下载对应版本的MySQL audit插件(支持MariaDB),至于MySQL的插件安装比较简单,记得以前有说过MySQL的半同步复制功能时,其中的半同步复制也是插件,需要的可以参看:http://

maridb安装审计audit插件

1.下载插件 https://mariadb.com/kb/en/mariadb-audit- plugin/ 比较新的mariadb版本audit插件直接内嵌在版本里,可以直接安装 INSTALL PLUGIN server_audit SONAME 'server_audit.so; 2.登录mysql服务器执行 SHOW VARIABLES LIKE 'plugin_dir'; 3.把插件cp 到plugindir目录下,安装一下(INSTALL PLUGIN server_audit S

MySQL5.7.14-下载安装教程-->MySQL数据库语句详细教程

如何下载: 我先去MySQL首页下载最新版本的MySQL-链接:https://www.mysql.com/downloads/ 进入此界面下载: Downloads–>MySQL Community Edition (GPL)(这是免费版的,当然,有钱的可以用收费的,功能更强大)–>MySQL Community Server (GPL) –>选择对应的系统和电脑版本(在这里,我选择的是Window系统64位的下载) –>No thanks, just start my down

Mysql学习之--卸载源码mysql-5.6安装mysql-5.5

Mysql学习之--卸载源码mysql-5.6安装mysql-5.5 系统环境: 操作系统:RedHat EL6 DB Soft:  Mysql 5.5.12     Mysql 在linux下的安装方式有两种版本,一种为Binary(二进制),另外一种为Source(源码包),本文为Source Install方式. 由于,本机已经安装了mysql-5.6的版本,前面的版本采用源码包安装,只需要删除相应的安装文件即可! 1.卸载mysql-5.6 删除/var/lib/mysql下的文件: [

percona-zabbix-templates插件安装监控MySQL

1.在zabbix客户端安装mysql监控插件rpm包 rpm -ivh https://www.percona.com/downloads/percona-monitoring-plugins/1.1.6/percona-zabbix-templates-1.1.6-1.noarch.rpmcd /var/lib/zabbix/percona/templatescp userparameter_percona_mysql.conf /usr/local/zabbix/etc/zabbix_ag

LNMP环境安装一、 Mysql5.7安装

编译安装mysql-5.7.17 1.打开官方网站下载最新的mysql-5.7.17源码包 注意:选择源码下载 2.在自定义目录保存 boost/mysql 或者mysql-boost http://downloads.sourceforge.net/project/boost/boost/1.59.0/boost_1_59_0.tar.gz http://cdn.mysql.com//Downloads/MySQL-5.7/mysql-boost-5.7.11.tar.gz http://cd

CentOS 6.5下编译安装httpd+mysql+php+phpMyAdmin

CentOS 6.5下编译安装httpd+mysql+php+phpMyAdmin+cacti+nagios 一.安装环境 Linux系统:CentOS 6.5 Apache版本:http-2.4.12 MySQL版本:MySQL 5.6.24 PHP版本:PHP-5.6.8 基本的安装顺序为:先安装httpd,然后安装mysql,最后安装PHP. 软件包: [[email protected] httpdbao]# ll total 334908 -rwxrw-rw-. 1 root root

(转) Linux(Centos7)yum安装最新mysql

原文:http://blog.csdn.net/gebitan505/article/details/54613549 环境 CentOS 7.1 (64-bit system) MySQL 5.6.24 CentOS 安装 参考:http://www.waylau.com/centos-7-installation-and-configuration/ 依赖 MySQL 依赖 libaio,所以先要安装 libaio yum search libaio # 检索相关信息 yum install

Linux安装JIRA6.3.6以及安装破解汉化插件

JIRA是Atlassian公司出品的项目与事务跟踪工具,被广泛应用于缺陷跟踪.客户服务.需求收集.流程审批.任务跟踪.项目跟踪和敏捷管理等工作领域. 一.搭建环境准备 Centos7.3下安装jira环境,所需的安装包: 1.mysql-5.7.17.tar.gz 下载地址:http://mirrors.sohu.com/mysql/MySQL-5.7/mysql-5.7.17.tar.gz 下载地址:https://downloads.mysql.com/archives/get/file/