Created
May 29, 2023 14:45
-
-
Save thesuhu/74e9d19d4d61b415ff972cf6af97c5a2 to your computer and use it in GitHub Desktop.
MySQL - Import CSV File with LOCAL INFILE
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 'g:\\temp\\file1.csv' | |
INTO TABLE mytable | |
FIELDS TERMINATED BY ';' -- Pemisah kolom dalam file CSV | |
ENCLOSED BY '"' -- Karakter penutup untuk kolom yang diapit oleh tanda kutip ("") | |
LINES TERMINATED BY '\r\n' -- Karakter akhir baris dalam file CSV | |
IGNORE 1 LINES -- Mengabaikan baris header pertama dalam file CSV (jika ada) | |
-- Kolom target dalam tabel | |
(COL1, COL2, COL3, COL4, COL5); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment