小编典典

正向工程MySQL Workbench错误1064

sql

我制作了一个EER图,并尝试对其进行正向工程,但出现此错误,但找不到错误。

在服务器中执行SQL脚本错误:错误1064:您的SQL语法有错误;错误1064。检查与您的MariaDB服务器版本相对应的手册以获取正确的语法,以在第13行的’INDEX
fk_User_Wallets1_idxWallets_idWalletsASC)VISIBLE,CONSTRAINT’附近使用

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

阅读 200

收藏
2021-03-17

共1个答案

小编典典

你可以添加引擎吗

ENGINE = InnoDB DEFAULT CHARSET = utf8 COLLATE = utf8_unicode_ci

2021-03-17