MySQL Audit Log Audit

Source: Internet
Author: User
Tags access database

First, Introduction

The database audit can record the database activity on the network in real time, carry on the fine-grained audit compliance management to the database operation, alarm the risk behavior of the database, block the attack behavior, and use it to record, analyze and report the behavior of the user Access database, to help the user to generate the compliance report afterwards, The accident traced, simultaneously strengthened the internal and external database network behavior record, enhances the data asset security.

MySQL Enterprise Edition has this feature, which belongs to the toll component, this beta social version uses third party open source plugins.

Two

Https://bintray.com/mcafee/mysql-audit-plugin/release/1.1.4-725#files

[Email protected] soft]# Unzip Audit-plugin-mysql-5.7-1.1.4-725-linux-x86_64.zip

CP libaudit_plugin.so/usr/local/mysql/lib/plugin/

Chown-r Mysql.mysql libaudit_plugin.so

Chmod-r 755 libaudit_plugin.so

Third, the command line installation operation and error resolution

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

ERROR (HY000): file ' mysqld ' not found (Errcode:2-No such File or directory)

mysql> INSTALL PLUGIN AUDIT SONAME '/opt/mysql/mysql-5.7.22-linux-glibc2.12-x86_64/lib/plugin/libaudit_plugin.so ‘;
ERROR 1124 (HY000): No paths allowed for shared library

Solution:

Reference 78827375

See if plug-in features are turned on

#show variables like ""%audit%;

To turn on plugin functionality:

Set global audit_json_file=1;

In the MySQL data directory, an extra Mysql-audit.json audit log will be given.

Viewing the Mysql-audit.json file, you can find the user name and IP address of the operation SQL statement, which provides a good monitoring effect on the operational database.

MySQL Audit Log Audit

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.