MySQL Forums
Forum List  »  Newbie

How to import a csv file
Posted by: Martin McGlensey
Date: May 21, 2015 03:38PM

Hello.

I'm trying to import a csv file to a table in MySQL/Mariadb. AS the file is on my pc I've set local-infile t 1. I've tried mysqlimport -u XXX -p Database --local "--fields-terminated-by=," "--lines-terminated-by\r\n" file.csv and
MySQL -u XXX -p LOAD DATA -L -D database INFILE file INTO TABLE table FIELDS TERMINATED BY ',' LINES TERMINATED BY '\r\n';. I've tried the load data command in Workbench. That time all the data did not load but some did. I do not know what I'm doing wrong. This has worked before. Now giving up after three hours of trying different methods. Would you guys give me the correct syntax to import a csv file as root.

Thanks to all who respond!

Marty

Options: ReplyQuote


Subject
Written By
Posted
How to import a csv file
May 21, 2015 03:38PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.