Last active
July 24, 2017 11:20
-
-
Save sanampatel/7c8f5434f0abd8b784634eb52d8fee19 to your computer and use it in GitHub Desktop.
Import CSV file into MySQL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LOAD DATA LOCAL INFILE '<file path here>' INTO TABLE <table name here> | |
FIELDS TERMINATED BY ',' | |
ENCLOSED BY '"' | |
LINES TERMINATED BY '\n' | |
(col1, col2, col3, col4, col5...); | |
/* | |
Also add below line to skip first header line from the CSV file | |
IGNORE 1 LINES | |
From database tables | |
(col1, col2, col3, col4, col5...); | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment