我是新来的数据库,我最近下载了mysql 5.1并从网站上学习命令。我无法将文件中的数据插入到数据库中。我正在使用命令行,并从 http://www.webdevelopersnotes.com/tutorials/sql/mysql_course_inserting_data_in_mysql_tables.php3 键入相同的命令,但它是发出错误..我正在使用Windows 7 ..是不支持的文件格式?或命令错误?请帮助...预先感谢 文件名是“nit.dat”...创建名为'nitish'的数据库和一个名为'stud'的表格现在我在命令行键入 mysql nitish < nit.dat ;
...并且我将文件nit.dat保存在bin目录中....该文件包含三个要插入的记录.....无法通过文本文件将数据插入到数据库中的表
insert into stud(id,name,age)values(99, nit“,23); insert into stud(id,name,age)values(22,“nit22”,12); insert into stud(id,name,age)values(10,“nit10”,56);
提示我输入与显示错误信息......
ERROR 1064 (42000): 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 'mysql nitish < nit.dat' at line 1
....怎么办?
我们需要更多的努力。发布您的文本文件(或至少其中的一部分),以便我们可以看到其中的内容,以及您使用的命令和收到的错误消息。 – TheOx 2012-03-17 13:41:00
@nitishrao:你创建了“nitish”表吗? – 2012-03-17 15:24:57
不......实际上,“nitish”是数据库名称,“stud”是表名......为什么要创建表“nitish”呢? – nitish712 2012-03-17 15:30:28