简体   繁体   中英

MySQL Dump Not Importing

I did a SQL Dump from my MySQL [version 5.6.12] a few days ago now I am trying to import back to the same DB.

The line

) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ; 

is not working, it throws a #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 ') ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 #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 ') ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ' error.

I have tripple checked the syntax, and even copped and pasted from one of the other tables that successfully import.

not sure what could be wrong. here is the full SQL: http://pastebin.com/hrBKv7Su .

NOTE: I know there are simlar posts none have helped so far.

When faced with a 1064 error that points to a specific location, look to the character or word right before it. There, you'll find an errant trailing comma in this case.

CREATE TABLE IF NOT EXISTS `item` (
  `id` mediumint(8) UNSIGNED NOT NULL AUTO_INCREMENT,
  `name` VARCHAR(11) NOT NULL,
  `string` VARCHAR(30) NOT NULL,
  `price` DECIMAL(9,2) NOT NULL,
  `note` VARCHAR(500) DEFAULT NULL,
  `categoryId` SMALLINT(5) UNSIGNED NOT NULL,
  `printerId` tinyint(3) NULL DEFAULT NULL,
  `hidden` tinyint(1) NOT NULL DEFAULT '0',
  `inStock` tinyint(1) NOT NULL DEFAULT '1',
  PRIMARY KEY (`id`),
  KEY `categoryId` (`categoryId`,`printerId`),
  KEY `printerId` (`printerId`),
  /* -------------------------^^^ remove that comma */
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM