数据库报错找了半天没解决 求帮助

MySql 码拜 8年前 (2016-05-20) 918次浏览
 create table `think_app`(
->  `aid` int(11) not null auto_increment,
-> `appname`varchar(255) not null,
-> `appkey`varchar(255) not null,
-> `banben`varchar(255) not null,
->  `qudao`int(11) not null,
-> `url`varchar(255) not null,
-> `iskaifang` enum(“0″,”1”) not null default “0”,
-> `starttime`varchar(255) not null,
-> `endtime`varchar(255) not null,
-> `everydaytime`set(“1″,”2″,”3″,”4″,”5″,”6″,”7″,”8″,”9″,”10″,”11″,”12″,”13″,”14″,”15″,”16″,”17″,”18″,”19″,”20″,”21″,”22″,”23″,”24”)not null,
-> `everymonthtoufang`int(11) not null,
-> `pinci`int(11) not null,
-> `del` enum(“0″,”1”) not null default “0”,
-> PRIMARY KEY (`aid`)
-> )ENGINE=MyISAM auto_increment=1 default;
ERROR 1064 (42000): 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 “” at line 16
解决方案

10

default 后面的参数呢   去掉default

10

最后一行的default删掉

20

mysql> create table `think_app`(
    ->  `aid` int(11) not null auto_increment,
    ->  `appname`varchar(255) not null,
    ->  `appkey`varchar(255) not null,
    ->  `banben`varchar(255) not null,
    ->  `qudao`int(11) not null,
    ->  `url`varchar(255) not null,
    ->  `iskaifang` enum("0","1") not null default "0",
    ->  `starttime`varchar(255) not null,
    ->  `endtime`varchar(255) not null,
    ->  `everydaytime`set("1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24")not null,
    ->  `everymonthtoufang`int(11) not null,
    ->  `pinci`int(11) not null,
    ->  `del` enum("0","1") not null default "0",
    ->  PRIMARY KEY (`aid`)
    -> )ENGINE=MyISAM auto_increment=1;
Query OK, 0 rows affected (0.03 sec)
mysql>

CodeBye 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权 , 转载请注明数据库报错找了半天没解决 求帮助
喜欢 (0)
[1034331897@qq.com]
分享 (0)