create table user_info(
id int primary key auto_increment,
username varchar(20) not null,
password varchar(20) not null
)
create table usercreatetime(
id int primary key auto_increment,
create_time datetime
);
create trigger trigger_addUserTime before insert on user_info for each row insert into usercreatetime(create_time) values(now());
insert into user_info(username,password) values("admin","admin888");
select * from usercreatetime;
更多关于MySQL相关内容感兴趣的读者可查看本站专题:《MySQL查询技巧大全》、《MySQL事务操作技巧汇总》、《MySQL存储过程技巧大全》、《MySQL数据库锁相关技巧汇总》及《MySQL常用函数大汇总》