導入數據時有錯誤

来源:2-4 将表的结构导入数据库中

大T

2018-12-18

#用户表 CREATE TABLE o2o_user( id int(11) unsigned NOT NULL auto_increment, username varchar(100) NOT NULL DEFAULT ‘’, password char(32) NOT NULL DEFAULT ‘’, code varchar(10) NOT NULL DEFAULT ‘’, last_login_ip varchar(20) NOT NULL DEFAULT ‘’, last_login_time int(11) unsigned NOT NULL default 0, email varchar(30) NOT NULL DEFAULT ‘’, mobile varchar(20) NOT NULL DEFAULT ‘’, listorder int(8) unsigned NOT NULL default 0, status tinyint(1) NOT NULL DEFAULT 0, create_time int(11) unsigned NOT NULL default 0, update_time int(11) unsigned NOT NULL default 0, PRIMARY KEY (id), UNIQUE KEY username(username), UNIQUE KEY email(email), )ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8

MySQL 回應: 說明文件
#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 ‘)ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8’ at line 19

写回答

1回答

singwa

2018-12-19

同学您好:

 UNIQUE KEY email(email),   这个这个地方多了一个逗号, 去掉再试试把。

0
0

Thinkphp5.0仿百度糯米开发多商家电商平台

【毕设】BAT大牛亲授ThinkPHP 5.0,实战中学透新技能,应用于工作

2439 学习 · 1712 问题

查看课程