简体   繁体   中英

MySQL Workbench 1064 error in syntax

MySQL Workbench created this code, not me. I just used the GUI.

Operation failed: There was an error while applying the SQL script to the database.
Executing:
ALTER TABLE `isometr1_keyboard`.`records` 
ADD CONSTRAINT `fk_records_layout_id`
  FOREIGN KEY ()
  REFERENCES `isometr1_keyboard`.`layouts` ()
  ON DELETE NO ACTION
  ON UPDATE NO ACTION;

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 ')
  REFERENCES `isometr1_keyboard`.`layouts` ()
  ON DELETE NO ACTION
  ON UPDAT' at line 3
SQL Statement:
ALTER TABLE `isometr1_keyboard`.`records` 
ADD CONSTRAINT `fk_records_layout_id`
  FOREIGN KEY ()
  REFERENCES `isometr1_keyboard`.`layouts` ()
  ON DELETE NO ACTION
  ON UPDATE NO ACTION

I don't understand where the error is. Also don't understand why the GUI is creating code that is buggy.

Did I make a mistake?

The data types of the columns were not matching. This caused MySQL Workbench to create improperly formed code.

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