Import not working
Hi all,
I'm very new to MySQL and when I saw the MySQL Workbench tutorial (http://www.packtpub.com/article/visual-mysql-database-design-in-mysql-workbench) I downloaded it and started working through the tutorial.
All went well until it came to importing what I had done (exactly the same as in the tutorial) I don't have access to the MySQL Command Line Client with my Web Host, I only have PHPMyAdmin and when I try importing the 'order.sql' file (see end) I get this error.
===============================================================================
Error
SQL query:
SET @OLD_SQL_MODE = @ @SQL_MODE ,
SQL_MODE = 'TRADITIONAL';
MySQL said: Documentation
#1231 - Variable 'sql_mode' can't be set to the value of 'TRADITIONAL'
===============================================================================
I created a database via cpanel called orders, didn't add or do anything else to it other than tried to import the below. I left the character set as utf8, set the SQL compatibility mode to MYSQL (tried all others too) but I can't import the file?
Can anyone help?
Thanks
The file I'm trying to import
===============================================================================
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='TRADITIONAL';
CREATE SCHEMA IF NOT EXISTS `mydb` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci ;
USE `mydb`;
-- -----------------------------------------------------
-- Table `mydb`.`order`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `mydb`.`order` (
`order_no` INT NOT NULL AUTO_INCREMENT ,
`order_date` DATETIME NOT NULL ,
`order_type` CHAR(1) NOT NULL DEFAULT 'S' ,
PRIMARY KEY (`order_no`) )
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `mydb`.`sales_order`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `mydb`.`sales_order` (
`customer_no` INT NOT NULL ,
`order_quantity` INT NULL ,
`order_order_no` INT NULL ,
PRIMARY KEY (`customer_no`) ,
INDEX fk_sales_order_order (`order_order_no` ASC) ,
CONSTRAINT `fk_sales_order_order`
FOREIGN KEY (`order_order_no` )
REFERENCES `mydb`.`order` (`order_no` )
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `mydb`.`purchase_order`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `mydb`.`purchase_order` (
`suplier_code` INT NOT NULL ,
`order_amount` DECIMAL(10,2) NULL ,
`order_order_no` INT NULL ,
PRIMARY KEY (`suplier_code`) ,
INDEX fk_purchase_order_order (`order_order_no` ASC) ,
CONSTRAINT `fk_purchase_order_order`
FOREIGN KEY (`order_order_no` )
REFERENCES `mydb`.`order` (`order_no` )
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB;
SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
===============================================================================