简体   繁体   中英

Cannot create table in mysql workbench

I am trying to add a table to my schema in MySQL workbench and I keep getting an error.

Message Log:

Executing:
CREATE TABLE `TestVisual`.`arc` (
    `arcid` INT NOT NULL DEFAULT 0 COMMENT '',
    `name` VARCHAR(45) NULL DEFAULT '' COMMENT '',
    PRIMARY KEY (`arcid`)  COMMENT '');

Operation failed: There was an error while applying the SQL script to the database.
ERROR 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 'COMMENT '')' at line 4
SQL Statement:
CREATE TABLE `TestVisual`.`arc` (
    `arcid` INT NOT NULL DEFAULT 0 COMMENT '',
    `name` VARCHAR(45) NULL DEFAULT '' COMMENT '',
    PRIMARY KEY (`arcid`)  COMMENT '')

I have tried to follow a tutorial but I still get the error. There are other tables already on this server and I am able to change their data along with add and delete columns. I am also on the root user.

Barmar answered it above in the comments. This server is using an older version of MySQL so there are not allowed to be COMMENT in the sql. Deleted them and it worked fine.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM