[size=18px]我们可以用文本文件的方式将所有记录加入你的数据库表中。创建一个文本文件“mysql.txt”,每行包含一个记录,用定位符(tab)把值分开,并且以在CREATE TABLE语句中列出的列次序给出,例如: abccs f 1977-07-07 china
mary f 1978-12-12 usa
tom m 1970-09-02 usa
使用下面命令将文本文件“mytable.txt”装载到mytable表中:mysql> LOAD DATA LOCAL INFILE "mytable.txt" INTO TABLE mytable; 出错:???????????????????????
mysql> load data local insert "E:/mysql.txt" into table mytable;
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 'inser
t "E:/mysql.txt" into table mytable' at line 1[/size]
mary f 1978-12-12 usa
tom m 1970-09-02 usa
使用下面命令将文本文件“mytable.txt”装载到mytable表中:mysql> LOAD DATA LOCAL INFILE "mytable.txt" INTO TABLE mytable; 出错:???????????????????????
mysql> load data local insert "E:/mysql.txt" into table mytable;
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 'inser
t "E:/mysql.txt" into table mytable' at line 1[/size]
http://dev.mysql.com/doc/refman/5.1/zh/sql-syntax.html#load-data