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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Importing CSV into DB

Status
Not open for further replies.

Noip

IS-IT--Management
Apr 25, 2002
240
MU
Hi,

before all I'm a newbie in MySQL and in DB in general. SO please do not use too technical terms when answering.

thanks

So, I am running MySQL 3.23.52 on RH 8.0 and using MySQL Front 2.5 to administer it from a win9x within the same LAN.

I have created a DB and a table inside it. I have then created 2 fields there. I have a CSV file that has got data for these 2 fields. I want to import the data onto my table. When I click on 'Im/Export' then 'Import textfile' and then choose the filename to import. I get the following message error:

LOAD DATA LOCAL INFILE 'C:/path/DB.csv' INTO TABLE mydb.mytable (field1,field2)
Error: 1148 - The used command is not allowed with this MySQL version

Also I noticed a note like this in the import window:
Note: the LOCAL INFILE feature is only available for MySQL-Versions > 3.22.6. On previous versions you will get an error!

What am I doing wrong. Thanks!
 
It's the "LOCAL" keyword you're using.

"LOCAL" means that the datafile resides on the client system, and that it will be transmitted to the server during the execution of your query. As the error message says, not all versions support this feature, and the default is for it to be turned off even in those versions that do support it.

Copy the CSV file to the server somewhere, then execute the query:
LOAD DATA INFILE <path and filename> .....

Want the best answers? Ask the best questions: TANSTAAFL!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top