| 1 |
include/master-slave.inc |
| 2 |
[connection master] |
| 3 |
drop table if exists t1; |
| 4 |
connection slave; |
| 5 |
reset master; |
| 6 |
CREATE TABLE IF NOT EXISTS mysql.server_audit_filters ( |
| 7 |
filtername char(80) COLLATE utf8_bin NOT NULL DEFAULT '', |
| 8 |
rule longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL DEFAULT 'true' CHECK (json_valid(rule)), |
| 9 |
CONSTRAINT c_filtername UNIQUE (filtername) |
| 10 |
) ENGINE=Aria; |
| 11 |
CREATE TABLE IF NOT EXISTS mysql.server_audit_users (host char(60) COLLATE utf8_bin NOT NULL DEFAULT '', |
| 12 |
user char(80) COLLATE utf8_bin NOT NULL DEFAULT '', |
| 13 |
filtername char(80) NOT NULL DEFAULT '', |
| 14 |
CONSTRAINT c_host_user UNIQUE (host, user) |
| 15 |
) ENGINE=Aria; |
| 16 |
INSERT INTO mysql.server_audit_filters VALUES ('ignore_sys', '{"ignore_tables" : "mysql.*"}'); |
| 17 |
INSERT INTO mysql.server_audit_users VALUES ('%','<replication_slave>','ignore_sys'); |
| 18 |
INSERT INTO mysql.server_audit_users VALUES ('%','root','ignore_sys'); |
| 19 |
install plugin server_audit soname 'server_audit2'; |
| 20 |
set global server_audit_logging=on; |
| 21 |
connection master; |
| 22 |
create table t1 (a int); |
| 23 |
insert into t1 values (1); |
| 24 |
truncate t1; |
| 25 |
drop table t1; |
| 26 |
connection slave; |
| 27 |
set global server_audit_logging=off; |
| 28 |
truncate mysql.server_audit_filters; |
| 29 |
truncate mysql.server_audit_users; |
| 30 |
INSERT INTO mysql.server_audit_filters VALUES ('no_logging','false'); |
| 31 |
INSERT INTO mysql.server_audit_users VALUES ('%','<replication_slave>','no_logging'); |
| 32 |
set global server_audit_logging=on; |
| 33 |
connection master; |
| 34 |
create table t1 (a int); |
| 35 |
insert into t1 values (1); |
| 36 |
truncate t1; |
| 37 |
drop table t1; |
| 38 |
connection slave; |
| 39 |
set global server_audit_logging=off; |
| 40 |
uninstall plugin server_audit; |
| 41 |
Warnings: |
| 42 |
Warning 1620 Plugin is busy and will be uninstalled on shutdown |
| 43 |
truncate mysql.server_audit_filters; |
| 44 |
truncate mysql.server_audit_users; |
| 45 |
TIME,HOSTNAME,,,0,0,AUDIT_CONFIG,,file_path=server_audit.log,0 |
| 46 |
TIME,HOSTNAME,,,0,0,AUDIT_CONFIG,,rotate_size=1000000,0 |
| 47 |
TIME,HOSTNAME,,,0,0,AUDIT_CONFIG,,file_rotations=9,0 |
| 48 |
TIME,HOSTNAME,root,localhost,ID,0,AUDIT_CONFIG,test,logging=ON,0 |
| 49 |
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'set global server_audit_logging=on',0 |
| 50 |
TIME,HOSTNAME,<replication_slave>,,ID,ID,CREATE,test,t1, |
| 51 |
TIME,HOSTNAME,<replication_slave>,,ID,ID,WRITE,test,t1, |
| 52 |
TIME,HOSTNAME,<replication_slave>,,ID,ID,CREATE,test,t1, |
| 53 |
TIME,HOSTNAME,<replication_slave>,,ID,ID,DROP,test,t1, |
| 54 |
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'select master_pos_wait(\'master-bin.#', POS, 300, \'\')',0 |
| 55 |
TIME,HOSTNAME,root,localhost,ID,0,AUDIT_CONFIG,test,logging=OFF,0 |
| 56 |
TIME,HOSTNAME,,,0,0,AUDIT_CONFIG,,file_path=server_audit.log,0 |
| 57 |
TIME,HOSTNAME,,,0,0,AUDIT_CONFIG,,rotate_size=1000000,0 |
| 58 |
TIME,HOSTNAME,,,0,0,AUDIT_CONFIG,,file_rotations=9,0 |
| 59 |
TIME,HOSTNAME,root,localhost,ID,0,AUDIT_CONFIG,test,logging=ON,0 |
| 60 |
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'set global server_audit_logging=on',0 |
| 61 |
TIME,HOSTNAME,root,localhost,ID,ID,QUERY,test,'select master_pos_wait(\'master-bin.#', POS, 300, \'\')',0 |
| 62 |
TIME,HOSTNAME,root,localhost,ID,0,AUDIT_CONFIG,test,logging=OFF,0 |
| 63 |
connection master; |
| 64 |
include/rpl_end.inc |