About the use of MySQL Enterprise Audit plugin

Source: Internet
Author: User

As previously seen in an article, if you want to know who landed your database server and what you did, then you need to use Mysql Enterprise Audit plugin.

Here 's how to use Mysql Enterprise Audit plugin:

Method One:

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

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 below this is to let the server open when monitoring whether audit log initialization. That is, if the audit log is not enabled, the server will not start.


Method Two:

1, the first step is universal

2. You can use the Install plugin command to add an audit function in your MySQL use:

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


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

<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 "/>

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

About the use of MySQL Enterprise Audit plugin

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.