CREATE TABLE `test_user` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`name` char(25) DEFAULT '' COMMENT '用户名',
`pw` char(32) DEFAULT '' COMMENT '密码',
`phone_num` int(11) unsigned DEFAULT NULL COMMENT '手机号',
`sex` tinyint(2) unsigned DEFAULT '1' COMMENT '性别 1男 2女',
`type` tinyint(2) unsigned DEFAULT '1' COMMENT '会员级别 1 普通 2 青铜 3 白银 4 黄金',
`create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`update_time` datetime DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '创建时间',
PRIMARY KEY (`id`),
UNIQUE KEY `phone_num` (`phone_num`),
KEY `phone_pw` (`phone_num`,`pw`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8 COMMENT='用户表';

 

mysql 5.7版本后时间datetime 默认为 0000-00-00 00:00:00 问题

 

相关文章:

  • 2021-08-16
  • 2021-11-19
  • 2022-12-23
  • 2021-12-05
  • 2021-09-27
  • 2022-12-23
  • 2021-10-08
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-05-17
  • 2022-12-23
相关资源
相似解决方案