正向工程 MySQL 工作台错误 1064

2022-01-15 00:00:00 sql mariadb mysql mysql-workbench

我制作了一个 EER 图,我正在尝试对其进行转发工程,但我收到此错误,但我找不到错误.

I made a EER diagram and I am trying to Forward Engineer it but I get this error and I can't find the mistake.

在服务器中执行 SQL 脚本 ERROR: Error 1064: You have an error in你的 SQL 语法;检查与您的 MariaDB 对应的手册在 'INDEX 附近使用正确语法的服务器版本fk_User_Wallets1_idx (Wallets_idWallets ASC) VISIBLE, CONSTRAINT '在第 13 行

Executing SQL script in server ERROR: Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'INDEX fk_User_Wallets1_idx (Wallets_idWallets ASC) VISIBLE, CONSTRAINT ' at line 13

SQL 代码:

        CREATE TABLE IF NOT EXISTS `mydb`.`User` (
          `idUser` INT NOT NULL AUTO_INCREMENT,
          `name` VARCHAR(45) NULL,
          `email` VARCHAR(45) NULL,
          `adress` VARCHAR(45) NULL,
          `password` VARCHAR(45) NULL,
          `saldo` INT NULL,
          `date_start` DATETIME NULL,
          `date_end` DATETIME NULL,
          `Rolls_idRolls` INT NOT NULL,
          `Wallets_idWallets` INT NOT NULL,
          PRIMARY KEY (`idUser`, `Rolls_idRolls`, `Wallets_idWallets`),
          INDEX `fk_User_Rolls1_idx` (`Rolls_idRolls` ASC) VISIBLE,
          INDEX `fk_User_Wallets1_idx` (`Wallets_idWallets` ASC) VISIBLE,
          CONSTRAINT `fk_User_Rolls1`
            FOREIGN KEY (`Rolls_idRolls`)
            REFERENCES `mydb`.`Rolls` (`idRolls`)
            ON DELETE NO ACTION
            ON UPDATE NO ACTION,
          CONSTRAINT `fk_User_Wallets1`
            FOREIGN KEY (`Wallets_idWallets`)
            REFERENCES `mydb`.`Wallets` (`idWallets`)
            ON DELETE NO ACTION
            ON UPDATE NO ACTION)
        ENGINE = InnoDB

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

Fetching back view definitions in final form.
Nothing to fetch

推荐答案

可以加引擎吗

ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci

ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci

相关文章