MySQL Workbench Error 1064

Dmitry Klimov picture Dmitry Klimov · Aug 16, 2015 · Viewed 10.4k times · Source

everyone! I'm newbie to MySQL. I've created a new model using Workbench tools(I mean, that I haven't written any string of code by myself). When trying to forward engineer it I get:

Executing SQL script in server
ERROR: 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 '')
ENGINE = InnoDB' at line 8
SQL Code:
    -- -----------------------------------------------------
    -- Table `university`.`CITY`
    -- -----------------------------------------------------
    CREATE TABLE IF NOT EXISTS `university`.`CITY` (
      `ID_CITY` INT NOT NULL COMMENT '',
      `CNAME` TEXT(15) NULL COMMENT '',
      `POPULATION` INT NULL COMMENT '',
      PRIMARY KEY (`ID_CITY`)  COMMENT '')
    ENGINE = InnoDB

SQL script execution finished: statements: 5 succeeded, 1 failed

 Fetching back view definitions in final form.
 Nothing to fetch

Moreover, when trying to forward engineer default Workbench model "sakila_full" i get the same thing:

Executing SQL script in server
ERROR: 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 '',
INDEX `idx_actor_last_name` (`last_name` ASC)  COMMENT '')
ENGINE ' at line 9
SQL Code:
    -- -----------------------------------------------------
    -- Table `sakila`.`actor`
    -- -----------------------------------------------------
    CREATE TABLE IF NOT EXISTS `sakila`.`actor` (
      `actor_id` SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT COMMENT '',
      `first_name` VARCHAR(45) NOT NULL COMMENT '',
      `last_name` VARCHAR(45) NOT NULL COMMENT '',
      `last_update` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '',
      PRIMARY KEY (`actor_id`)  COMMENT '',
      INDEX `idx_actor_last_name` (`last_name` ASC)  COMMENT '')
    ENGINE = InnoDB
    DEFAULT CHARACTER SET = utf8

 SQL script execution finished: statements: 5 succeeded, 1 failed

 Fetching back view definitions in final form.
Could not get definition for sakila.customer_list from server
Could not get definition for sakila.film_list from server
Could not get definition for sakila.nicer_but_slower_film_list from server
Could not get definition for sakila.staff_list from server
Could not get definition for sakila.sales_by_store from server
Could not get definition for sakila.sales_by_film_category from server
Could not get definition for sakila.actor_info from server
7 views were read back.

Thanks in advance!

Answer

René picture René · Sep 4, 2015

Well, the BIG probleme is that Mysql Workbench adds itself indexes comments that generate an error, when using "Forward Engineer" or "Synchronize Model"

This problem did not exist when I was using version 6.0.