About the use of MySQL Enterprise Audit plugin

Source: Internet
Author: User

As seen earlier in an article, the false idea is to know who landed your database server and what you did, then you need to use Mysql Enterprise Audit plugin.

The following describes the use of Mysql Enterprise Audit plugin:

Method One:

1. Find audit_log.so in your MySQL installation folder. Mine is under the/usr/lib/mysql/plugin/folder.

2. Add plugin-load=audit_log.so to your my.cnf file to enable MySQL to start the audit log function at startup. In general, you will also add a audit-log=force_plus_permanent this is to let the server open when the monitor audit log initialization. Other words. Assume that the audit log is not enabled. Then the server is not started.


Method Two:

1, the first step is universal

2, in your MySQL use can use the Install plugin command to join the audit function:

mysql> INSTALL PLUGIN audit_log SONAME ' audit_log.so ';


Started Mysql Enterprise Audit plugin Let's take a look at the log content:

By default, the MySQL audit log is stored in/var/lib/mysql/audit.log

<audit_record timestamp= "2015-07-21t08:00:27 UTC" record_id= "6130_2015-07-21t07:56:43" NAME= "Query" CONNECTION_ Id= "3" status= "0" status_code= "0" user= "root[root" @ localhost [] "os_login=" "host=" localhost "ip=" "command_class=" Show_tables "sqltext=" Show Tables "/>
<audit_record timestamp= "2015-07-21t08:00:38 UTC" record_id= "6131_2015-07-21t07:56:43" NAME= "Query" CONNECTION_ Id= "3" status= "0" status_code= "0" user= "root[root" @ localhost [] "os_login=" "host=" localhost "ip=" "command_class=" Select "Sqltext=" SELECT * from final "/>

About the use of MySQL Enterprise Audit 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.