Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mysqlimport syntax error

Status
Not open for further replies.

JoLiang

Programmer
May 5, 2004
4
US
Dear all;

I am up to my hairs. I am new to mysql. I installed mysql 4.0.18 on my windows xp machine. I am trying to import a DB from flat files. I have created the database and tables. Then I try to use the mysqlimport to do the task. I get errors.

Here is two versions of syntax I used:
mysqlimport -u user -p database 'F:\\path\\*.dat' --fields-terminated-by="|";

anther version:

mysqlimport -u user -p database "F:/path/*.dat" --fields-terminated-by="|" --local --verbose --replace;


For either version, I get the following error:

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 'mysqlimport -u user -p database 'F:\\path\\*.dat'

I could not figure out why.

thanks in advance for any help
Jo
 
I tried the command from the dos command window from %mysql_home%\bin

I tried the command from the mysql command line client mysql>

both give me the same error.

I tried the following and get another error:
mysqlimport -u user -p --fields-terminated-by="|" database 'f:\\path\\*.dat'

I get the following error:
mysqlimport: Error: 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 'f://path//*.dat' ' INTO TABLE * FIELDS, when using table: *

Jo

 
Try the following:
[tt]
mysqlimport -u user -p --fields-terminated-by="|" database
'f:/path/file1.dat' 'f:/path/file2.dat' 'f:/path/file3.dat'
[/tt]

(all on one line)


-----
ALTER world DROP injustice, ADD peace;
 
Hi, Tony;

thanks for the answer. It still gives me an error:
Error 1064: You have an error in your SQL syntax.


I begin to think that maybe there is a corruption in the installation.

Or is there any other possibilities?

I also tried :
Try the following:

mysqlimport -u user -p --fields-terminated-by="|" database 'f:/path/file1.dat' into table file1;

And it also gives me Error 1064


Jo
 
You could try doing it by SQL instead.
For example:
[tt]
LOAD DATA LOCAL INFILE 'f:/path/file1.dat'
INTO TABLE tbl1
LINES TERMINATED BY '|'
[/tt]


-----
ALTER world DROP injustice, ADD peace;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top