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

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了MySql - syntax error: unexpted "user" (Single quoted text)相关的知识,希望对你有一定的参考价值。

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)的主要内容,如果未能解决你的问题,请参考以下文章

Mysql错误 ERROR 1064 (42000): You have an error in your SQL syntax

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

MySQL错误[ERR] 1064 - You have an error in your SQL syntax;

Mysql排错:[Err] 1064 - You have an error in your SQL syntax;

C# Mysql You have an error in your SQL syntax; check the manual that corresponds to your MySQL ser

MYSQL8创建新用户报错:You have an error in your SQL syntax;check...