最近做mysql的安全审计
开启general_log日志,默认文本记录
show global variables like '%general%';
set global general_log = on;
show global variables like '%log_output%';
设置表级别存操作记录
set global log_output = 'TABLE';
use mysql;//存在mysql库
show create table general_log;//建表
SELECT * from general_log where command_type='Connect';//过滤出登陆的日志
flush privileges;//刷新权限才能新建用户
create user 'test'@'localhost' identified by '123';