ERROR: Error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')
I'm guessing maybe it does not like creating a table with no columns?
01-01-2013, 10:47 AM
droidus
here is the full sql:
Code:
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,ALLOW_INVALID_DATES';
CREATE SCHEMA IF NOT EXISTS `mydb` DEFAULT CHARACTER SET latin1 COLLATE latin1_swedish_ci ;
USE `mydb` ;
-- -----------------------------------------------------
-- Table `mydb`.`dvd_collection`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `mydb`.`dvd_collection` (
)
ENGINE = InnoDB;
-- -----------------------------------------------------
-- Table `mydb`.`movies`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `mydb`.`movies` (
`movie_id` INT NOT NULL AUTO_INCREMENT ,
`title` DATE NOT NULL ,
`release_date` DATE NULL ,
PRIMARY KEY (`movie_id`) )
ENGINE = InnoDB;
SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
I just tested it locally, and it worked fine once I added one column to the definition:
Code:
CREATE TABLE IF NOT EXISTS `mydb`.`dvd_collection` (
`foo` INT(9)
)
ENGINE = InnoDB;
01-01-2013, 02:48 PM
droidus
so what is it exactly saying is wrong with ')?
01-01-2013, 09:47 PM
NogDog
It's saying, in it's rather simpleton-like way, that its parser encountered a closing ")" at a point were it did not expect to find one (i.e., not until after at least one column has been specified).