我正在尝试建立一个数据库以了解有关 MySQL 中触发器的更多信息。
所以我用 mysql-workbench 创建了一个数据库模型。如果我尝试将模型与 mysql-server 同步,则会收到 1064 语法错误:
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 ') NOT NULL ,
PRIMARY KEY (`employee_id`, `accounts_id`) ,
INDEX `fk_accountA' at line 4
CREATE TABLE IF NOT EXISTS `pzedb`.`accountAmounts` (
`employee_id` INT(11) NOT NULL ,
`accounts_id` INT(11) NOT NULL ,
`accountAmount` DOUBLE(11) NOT NULL ,
PRIMARY KEY (`employee_id`, `accounts_id`) ,
INDEX `fk_accountAmounts_employee1` (`employee_id` ASC) ,
INDEX `fk_accountAmounts_accounts1` (`accounts_id` ASC) ,
CONSTRAINT `fk_accountAmounts_employee1`
FOREIGN KEY (`employee_id` )
REFERENCES `pzedb`.`employee` (`id` )
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_accountAmounts_accounts1`
FOREIGN KEY (`accounts_id` )
REFERENCES `pzedb`.`accounts` (`id` )
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB
DEFAULT CHARACTER SET = latin1
COLLATE = latin1_swedish_ci
SQL script execution finished: statements: 11 succeeded, 1 failed
我试图将字段更改为 VARCHAR,我应该说它有效。我将其他字段更改为 DOUBLE 并得到相同的错误。
有什么问题还是我太笨而无法使用工作台?
我的操作系统:Debian 7.1 MySQL:5.5.31-0+wheezy1 工作台:5.2.40 rev 8790