How can we import data in MySQL from CSV file
Run this SQL script either from a mysql console or from your favorite scripting language (PHP, PERL…)
LOAD DATA LOCAL INFILE ‘/path-to-file/dump_file.csv’
INTO TABLE table_name
FIELDS TERMINATED BY ‘,’
LINES TERMINATED BY ‘\n’
(Field_1, Filed_2, Field_3);
I believe the syntax is more than clear so I won’t bother explaining too much.
Leave a Reply
You must be logged in to post a comment.
Categories
Recent Posts
Tags
.NET
ayon
BackgroundWorker
backup
backup file
COCOA
command line
CSV
CSV file
database
DataSet
DataSet Creation
dump
Excel
export
form
form transparency
hackintosh
HTTP POST
import
import data
JavaScript
javascript inject
money online
MouseEventHandler
MySQL
MySQL dump
NSMutableURLRequest
NSString
NSURLConnection
Objective-C
opacity
OSX
OSx86
payperpost
PHP
plugin
restore
sendSynchronousRequest
server
SpVoice
sql file
TEXT-TO-SPEECH
transparency
WordPress