码迷,mamicode.com
首页 > 数据库 > 详细

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

时间:2017-04-23 21:35:46      阅读:479      评论:0      收藏:0      [点我收藏+]

标签:ted   cte   unique   var   sql   creat   mysql   原因   mysq   

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)

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

标签:ted   cte   unique   var   sql   creat   mysql   原因   mysq   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!