Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to bulk insert data from cvs file into MySQL database?

Posted on 2007-03-19
3
Medium Priority
?
1,052 Views
Last Modified: 2009-12-16
How to bulk insert data from cvs file into MySQL database?
0
Comment
Question by:ztot
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 18746813
please check out the LOAD DATA INFILE statement from MySQL:
http://dev.mysql.com/doc/refman/5.0/en/load-data.html
0
 

Author Comment

by:ztot
ID: 18746936
Hi thanks for your speedy reply. I have manage to bulk insert the data, however every last field will end with new line (or return carriange).

Example:
Row1.1 Row1.2 Row1.3<new line>
Row2.1 Row2.2 Row2.3<new line>

How to remove the last "new line" command so it will show only Row1.1 Row1.2 Row1.3
0
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 18746947
did you specify the following option:
LINES TERMINATED BY '\n'

if yes, does the file eventually have '\r\n' or the like... you will have to specify the exact "line terminator" sequence of the file...
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
By, Vadim Tkachenko. In this article we’ll look at ClickHouse on its one year anniversary.
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question