设置init-connect 创建数据库 create database accesslog; create table accesslog.accesslog (`id` int(11) primary key auto_increment,`time` timestamp,`localname` varchar(30),`matchname` varchar (30)) 授权用户 grant read on accesslog.* to root@'%' identified by '1qazxsw'; 设置init-connect [mysqld] init-connect='insert into accesslog.accesslog values(connection_id(),user(),current_user(),now());'