尝试填充数据库时出现 SQL 语法错误 1064
我不断收到以下错误消息
错误 1064 (42000):您的 SQL 语法有错误;检查与您的 MySQL 服务器版本相对应的手册,了解在第 1 行 ''isbn10','isbn13','title','edition','author_f_name','author_m_name','author_l_na' 附近使用的正确语法
。使用以下命令从 MySQL 命令行填充我的 MySQL 数据库:
source C:\myFilePath\myFileName.sql
这是我的 mysqldump
的摘录(显示本书的表结构)。
我哪里出错了?:
--
-- Table structure for table `book`
--
DROP TABLE IF EXISTS `book`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `book` (
`book_id` int(11) NOT NULL AUTO_INCREMENT,
`isbn10` char(20) DEFAULT NULL,
`isbn13` char(20) DEFAULT NULL,
`title` char(20) DEFAULT NULL,
`edition` char(20) DEFAULT NULL,
`author_f_name` char(20) DEFAULT NULL,
`author_m_name` char(20) DEFAULT NULL,
`author_l_name` char(20) DEFAULT NULL,
`cond` enum('as new','very good','good','fair','poor') DEFAULT NULL,
`price` decimal(8,2) DEFAULT NULL,
`genre` char(20) DEFAULT NULL,
PRIMARY KEY (`book_id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `book`
--
USE books;
INSERT INTO book ('isbn10','isbn13','title','edition','author_f_name','author_m_name','author_l_name','cond','price','genre')
VALUES ('0136061699','978-0136061694','Software Engineering: Theory and Practice','4th Edition','Shari','Lawrence','Pfleeger','very good','50','Computing');
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不要在列名称周围使用单引号。单引号表示字符串,您不使用字符串作为列名。
尝试将您的脚本更改为:
Don't use single quotes around the column names. Single quotes means strings, you don't use strings for column names.
Try changing your script to this: