MySQLWorkbench正向工程错误 [英] MySQLWorkbench forward engineering error

查看:272
本文介绍了MySQLWorkbench正向工程错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用MySql Workbench 8.0中的模型进行工作,当我单击正向工程并尝试生成我所得到的模型脚本时

I'm working on a model in MySql Workbench 8.0, when I click on forward engineering and try to generate the script of my model 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 'VISIBLE,
  CONSTRAINT `fk_Compras_Personas`
    FOREIGN KEY (`persona_id`)
    R' at line 9
SQL Code:
        -- -----------------------------------------------------
        -- Table `bd_inventario2018_2`.`compras`
        -- -----------------------------------------------------
        CREATE TABLE IF NOT EXISTS `bd_inventario2018_2`.`compras` (
          `nmcompra` INT(11) NOT NULL,
          `persona_id` INT(11) NOT NULL,
          `fecompra` DATE NOT NULL,
          PRIMARY KEY (`nmcompra`, `persona_id`),
          INDEX `fk_Compras_Personas_idx` (`persona_id` ASC) VISIBLE,
          CONSTRAINT `fk_Compras_Personas`
            FOREIGN KEY (`persona_id`)
            REFERENCES `bd_inventario2018_2`.`personas` (`id`)
            ON DELETE NO ACTION
            ON UPDATE NO ACTION)
        ENGINE = InnoDB
        DEFAULT CHARACTER SET = utf8

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

Fetching back view definitions in final form.
Nothing to fetch

或者当我尝试同步模型时我得到

Or when i try to syncronize the model 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 'VISIBLE' at line 4
SQL Code:
        ALTER TABLE `bd_inventario2018_2`.`productos` 
        ADD COLUMN `anchetas_id` INT(11) NOT NULL AFTER `psventa`,
        ADD COLUMN `productoscol` VARCHAR(45) NOT NULL AFTER `anchetas_id`,
        ADD INDEX `fk_productos_Anchetas1_idx` (`anchetas_id` ASC) VISIBLE

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

Fetching back view definitions in final form.
Nothing to fetch

有人知道发生了什么事吗?这是一个自动过程,我不会覆盖任何内容,

Someone knows what's happening? This is an automatic process, I'm not overwritting anything,

谢谢

推荐答案

MySQL Workbench正在为MySQL 8(它支持新的不可见索引)生成脚本,而您可能没有.

MySQL Workbench is generating the script for MySQL 8 (which supports the new invisible indexes), which you likely do not have.

您需要在Model\Model Options\MySQL\Target MySQL Version或全局在Edit\Preferences\Modelling\MySQL\Target MySQL Version中指定要使用的MySQL版本.

You need to specify the MySQL version you are using, either in Model\Model Options\MySQL\Target MySQL Version or, globally, in Edit\Preferences\Modelling\MySQL\Target MySQL Version.

这篇关于MySQLWorkbench正向工程错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆