为了账号安全,请及时绑定邮箱和手机立即绑定

到达建表那一块,用mysql bench 建的两张表,在navicate报错打不开,请问老师或同学们如何处理?

USE `mydb` ;

-- -----------------------------------------------------

-- Table `mydb`.`user`

-- -----------------------------------------------------

DROP TABLE IF EXISTS `mydb`.`user` ;


CREATE TABLE IF NOT EXISTS `mydb`.`user` (

  `user_id` INT NOT NULL AUTO_INCREMENT,

  `username` VARCHAR(20) NOT NULL,

  `password` CHAR(32) NOT NULL,

  `create_at` DATETIME NOT NULL,

  PRIMARY KEY (`user_id`),

  INDEX `username` (`username` ASC) VISIBLE,

  INDEX `create_at` (`create_at` ASC) VISIBLE)

ENGINE = InnoDB

DEFAULT CHARACTER SET = utf8;

-- -----------------------------------------------------

-- Table `mydb`.`article`

-- -----------------------------------------------------

DROP TABLE IF EXISTS `mydb`.`article` ;


CREATE TABLE IF NOT EXISTS `mydb`.`article` (

  `article_id` INT NOT NULL,

  `title` VARCHAR(40) NOT NULL,

  `content` TEXT NOT NULL,

  `user_id` INT NOT NULL,

  PRIMARY KEY (`article_id`),

  INDEX `fk_article_user_idx` (`user_id` ASC) VISIBLE,

  CONSTRAINT `fk_article_user`

    FOREIGN KEY (`user_id`)

    REFERENCES `mydb`.`user` (`user_id`)

    ON DELETE NO ACTION

    ON UPDATE NO ACTION)

ENGINE = InnoDB

DEFAULT CHARACTER SET = utf8;


SET SQL_MODE=@OLD_SQL_MODE;

SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;

SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;

[SQL] Finished successfully with error

正在回答

举报

0/150
提交
取消

到达建表那一块,用mysql bench 建的两张表,在navicate报错打不开,请问老师或同学们如何处理?

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信