CREATE TABLE `mi`.`mi_oauth` (
`id` int NOT NULL AUTO_INCREMENT,
`uid` int NOT NULL COMMENT '用户ID',
`oauth_type` int NOT NULL DEFAULT 1 COMMENT '1 QQ登录\r\n2 微信登录\r\n3 新浪微博登录',
`access_token` varchar(255) NOT NULL COMMENT '不同平台返回的token',
`oauth_uid` varchar(255) NOT NULL COMMENT '授权用户唯一标识',
`expires_in` varchar(255) NULL COMMENT 'access_token的生命周期,不同平台不一样',
`oauth_date` int NOT NULL COMMENT '授权时间',
PRIMARY KEY (`id`) ,
UNIQUE INDEX `uid` (`uid`)
)
ENGINE=MyISAM
COMMENT='用户授权信息表'
;
[Msg] Failed - Error on Table mi_oauth - 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'NOT NULL COMMENT '不同平台返回的token',
`oauth_uid` varchar NOT NULL COM' at line 5
创建表的时候,一直报错!各种检查!最后发现原来是因为varchar没有规定长度导致的!