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