我在eer图中创建了我的关系,我想在表上看到perting键。我读了这篇文章
但是当我这样做时,有这样的错误:
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 '(11) NOT NULL AFTER `UserId`
, DROP PRIMARY KEY
, ADD PRIMARY KEY (`AddressId' at line 1
ALTER TABLE `kobiakinlar`.`address` ADD COLUMN `user_UserId` (11) NOT NULL AFTER `UserId`
, DROP PRIMARY KEY
, ADD PRIMARY KEY (`AddressId`, `user_UserId`)
, ADD INDEX `fk_address_user_idx` (`user_UserId` ASC)
SQL script execution finished: statements: 3 succeeded, 1 failed
如何将表与eer图同步。
我注意到我需要将MySQL存储引擎设置为InnoDB。正如您在MySQL Workbench外键选项卡中看到的那样,服务器接受其他存储引擎的外键定义,但默默地忽略了它们。您可以在此处阅读有关存储引擎的信息。