如下:
CREATE TABLE `loginlog` ( `id` int(10) unsigned zerofill NOT NULL AUTO_INCREMENT COMMENT '主键编号', `IP` varchar(100) NOT NULL COMMENT 'ip地址主键', `version` int(11) NOT NULL DEFAULT '1' COMMENT '登录次数', `address` varchar(100) NOT NULL COMMENT '登录地址', `loginTime` TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3) COMMENT '当前登录时间', `lastLogin` TIMESTAMP(3) NOT NULL DEFAULT '0000-00-00 00:00:00.000' COMMENT '最后登录时间', PRIMARY KEY (`id`,`IP`), UNIQUE KEY `id` (`id`) ) ENGINE=INNODB DEFAULT CHARSET=utf8 COMMENT='登录信息表';