DROP TABLE IF EXISTS `jlm_activity_exchange_code`;
CREATE TABLE `jlm_activity_exchange_code`(
`id` Int( 11 ) UNSIGNED AUTO_INCREMENT NOT NULL,
`code` VarChar( 32 ) NULL COMMENT '兑奖码',
`uid` Int( 11 ) NULL COMMENT '用户uid',
`level` TinyInt( 3 ) NOT NULL DEFAULT '4' COMMENT '奖品等级 0特等奖 1一等奖 2二等奖 3三等奖 4没有奖',
`status` TinyInt( 3 ) NULL DEFAULT '0' COMMENT '状态 0已发放 1已兑换 -1已失效',
`create_time` DateTime NULL COMMENT '兑奖码生成时间',
`exchange_time` Datetime NULL COMMENT '兑奖码兑换时间',
PRIMARY KEY ( `id` ))
CHARACTER SET = utf8
COLLATE = utf8_general_ci
COMMENT '兑奖码表'
ENGINE = InnoDB;
CREATE INDEX `code` USING BTREE ON `jlm_activity_exchange_code`( `code` );

Ubuntu 14.04 + MySQL 5.5.47测试没有问题,P.S.我的数据库服务器默认编码格式为utf8;