简体   繁体   English

MySQL转储不导入

[英]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. 几天前,我从MySQL [版本5.6.12]进行了SQL Dump,现在我正尝试导入回同一数据库。

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 #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. #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

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 . 这是完整的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. 当遇到指向特定位置的1064错误时,请查看它前面的字符或单词。 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 ;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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