I have created a small db with 3 tables in MySQL Workbench. After creating a table I've inserted some data into it, and it works fine. Now i have another pc. I exported the model as a mwb file from the first pc and i want to import that mwb file to my 2nd pc. Here is the error i get while importing the model (forward engineering) to my 2nd pc. I don't understand why the model created in MySQL Workbench doesn't work in another pc's workbench. Can someone help? Thank you.mwb file codes i wanted to import
errors i got when forward engineering
Edit: This is the script that gives error now :
-- MySQL Workbench Forward Engineering
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION';
-- -----------------------------------------------------
-- Schema mydb
-- -----------------------------------------------------
-- -----------------------------------------------------
-- Schema karakoyd
-- -----------------------------------------------------
-- -----------------------------------------------------
-- Schema karakoyd
-- -----------------------------------------------------
CREATE SCHEMA IF NOT EXISTS `karakoyd` DEFAULT CHARACTER SET utf8 COLLATE utf8_turkish_ci ;
USE `karakoyd` ;
-- -----------------------------------------------------
-- Table `karakoyd`.`emp`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `karakoyd`.`emp` (
`idemp` NOT NULL,
`name` VARCHAR(45) NOT NULL,
`email` VARCHAR(255) NOT NULL,
`pass` VARCHAR(255) NOT NULL,
`salt` VARCHAR(19) NOT NULL,
`log` VARCHAR(45) NOT NULL,
`rütbe` VARCHAR(45) NOT NULL,
PRIMARY KEY (`idemp`),
UNIQUE INDEX `idemployee_UNIQUE` (`idemp` ASC) VISIBLE)
ENGINE = InnoDB
AUTO_INCREMENT = 19
DEFAULT CHARACTER SET = utf8
COLLATE = utf8_turkish_ci;
From what I see, in your images, you can not create columns in your tables without defining the type of the column.
For example in your table EMP
you are creating it like this:
idemp not null
and it should be like this(just for example):
idemp int not null
And a new demo with your table
This is how your TABLE code should look like.
CREATE TABLE IF NOT EXISTS `karakoyd`.`emp` (
`idemp` int NOT NULL, --the change was made here(column's data type was missing)
`name` VARCHAR(45) NOT NULL,
`email` VARCHAR(255) NOT NULL,
`pass` VARCHAR(255) NOT NULL,
`salt` VARCHAR(19) NOT NULL,
`log` VARCHAR(45) NOT NULL,
`rütbe` VARCHAR(45) NOT NULL,
PRIMARY KEY (`idemp`),
UNIQUE INDEX `idemployee_UNIQUE` (`idemp` ASC) VISIBLE)
ENGINE = InnoDB
AUTO_INCREMENT = 19
DEFAULT CHARACTER SET = utf8
COLLATE = utf8_turkish_ci;