我通过XAMPP启动了MySQL数据库,并尝试使用MySQL Workbench连接到数据库服务器。单击确定按钮进行连接后,MySQL Workbench停止工作。
MySQL Workbench Version: 6.3.7 build 1199 CE (64 bits)
即使我使用 Forward Engineer to Database ,它也会显示Operation has completed with errors. Please see logs for details.
。消息日志显示如下。
ERROR: Error 1005: Can't create table `codespace`.`terminalpreferences` (errno: 121 "Duplicate key on write or update")
SQL Code:
-- -----------------------------------------------------
-- Table `CodeSpace`.`TerminalPreferences`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `CodeSpace`.`TerminalPreferences` (
`id` INT ZEROFILL UNSIGNED NOT NULL AUTO_INCREMENT,
`acePreferenceId` INT UNSIGNED NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
UNIQUE INDEX `id_UNIQUE` (`id` ASC),
UNIQUE INDEX `acePreferenceId_UNIQUE` (`acePreferenceId` ASC),
CONSTRAINT `acePreferenceId`
FOREIGN KEY (`acePreferenceId`)
REFERENCES `CodeSpace`.`ACEPreferences` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB
SQL script execution finished: statements: 9 succeeded, 1 failed
Fetching back view definitions in final form.
Could not get definition for CodeSpace.All_User from server
1 views were read back.
这是否意味着如果我没有正确设置数据库,我无法连接到它?或者,这是一个错误?
在我解决了数据库设计中的所有错误并成功将工程师转发到数据库之后。连接问题仍未解决。