MySql - syntax error: unexpted "user" (Single quoted text)

时间:2017-04-23 21:28:53   收藏:0   阅读:2183
create table user(
id int(10) not null,
username varchar(20) not null,
password varchar(20) not null,
primary key (id),
unique key username);

错误原因:  去掉 单引号, 改为如下

mysql> create table user(
    -> id int(10) not null,
    -> username varchar(20) not null unique,
    -> password varchar(20) not null,
    -> primary  key (id),
    -> unique key ulist (username)
    -> );
Query OK, 0 rows affected, 1 warning (0.32 sec)

原文:http://www.cnblogs.com/FightZ/p/6754076.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!