【发布时间】:2012-03-17 13:38:50
【问题描述】:
我是数据库新手,我最近下载了 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 目录中...该文件包含要插入的三个记录.....
插入螺柱(id,name,age)值(99,“nit”,23); 插入螺柱(id,name,age)值(22,“nit22”,12); 插入螺柱(id,name,age)值(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 .... 怎么办?
【问题讨论】:
-
我们需要做的远不止这些。发布您的文本文件(或至少其中一些),以便我们查看其中的内容,以及您使用的命令和收到的错误消息。
-
@nitishrao:你创建了表'nitish'吗?
-
不...实际上'nitish'是数据库名称,'stud'是表名...为什么要创建表'nitish'呢??
标签: mysql