1. 程式人生 > >MariaDB從刪庫到跑路之ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corres

MariaDB從刪庫到跑路之ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corres

新人中午寫個表遇見了

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near...

如圖:

我覺得沒有一點毛病:

create table students (ID int NOT NULL AUTO_INCREMENT,NAME varchar(21) NOT NULL,CHARACTER varchar(21),ADDRESS char(100),PHONE_NUMBER char(11),REMARKS varchar(100),PRIMARY KEY (ID));

可是出錯在哪呢。。。

根據提示,鎖定在CHARACTER開始之後

稍微一修改竟然成了:

改的地方就是把 CHARACTER 後加上了 S 變成 CHARACTERS

create table students (ID int NOT NULL AUTO_INCREMENT,NAME varchar(21) NOT NULL,CHARACTERS varchar(21),ADDRESS char(100),PHONE_NUMBER char(11),REMARKS varchar(100),PRIMARY KEY (ID));

網上一查,原來character是一條命令:

小菜雞還需多學習。