Percona5.6 provides the audit log function for the first time _ MySQL

Source: Internet
Author: User
Tags percona server
Percona5.6 provides the audit log function for the first time. if one day a record is lost in the database, developers will ask you to check who was taken from which IP address and perform the delete operation, therefore, it cannot be found in the previous version, and Percona's latest version 5.6.17 provides the audit log function for the first time.

(Note: As of January 1, May 19, 2014, the official MySQL5.6.17 and MariaDB10.0.11 did not provide this function)

Version:

5.6.17-65.0-rel65.0-log Percona Server with XtraDB (GPL), Release rel65.0, Revision 587

Install plug-ins:

INSTALL PLUGIN audit_log SONAME 'audit_log.so';

Show plugins; you will find

| audit_log | ACTIVE | AUDIT| audit_log.so | GPL |

Variable parameters:

mysql> show global variables like 'audit%';+--------------------------+--------------+| Variable_name| Value|+--------------------------+--------------+| audit_log_buffer_size| 1048576|| audit_log_file | audit.log|| audit_log_flush| OFF|| audit_log_format | NEW|| audit_log_policy | ALL|| audit_log_rotate_on_size | 0|| audit_log_rotations| 0|| audit_log_strategy | ASYNCHRONOUS |+--------------------------+--------------+8 rows in set (0.00 sec)

It will first write logs into the memory and then fl them into the disk.

The following four policies can be adjusted for the audit_log_strategy parameter:

1、ASYNCHRONOUS log using memory buffer, do not drop events if buffer is full2、PERFORMANCE log using memory buffer, drop events if buffer is full3、SEMISYNCHRONOUS log directly to file, do not fsync every event4、SYNCHRONOUS log directly to file, fsync every event

Use the default value here.

The audit_log_rotate_on_size parameter indicates that the defined value is exceeded and the log is automatically rotated and split.

The audit_log_rotations parameter specifies the number of files.

Effect:

References: http://www.mysqlperformanceblog.com/2014/05/16/introduction-to-the-percona-mysql-audit-log-plugin/

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.