Skip to content

Instantly share code, notes, and snippets.

@clasense4
Created December 1, 2014 09:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clasense4/af1e4d964ee335125576 to your computer and use it in GitHub Desktop.
Save clasense4/af1e4d964ee335125576 to your computer and use it in GitHub Desktop.
MySQL Insert Data from CSV

Intro

Well, for hours i have been so frustated why my insert file does not work, so this is the solution.

I use MariaDB 10.0.14

LOAD DATA local INFILE "/tmp/pengguna.csv"  INTO TABLE pengguna_dapodik_tokudb FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' ESCAPED BY '"' LINES TERMINATED BY '\r\n' ( `username`, `password`, `nama`, `sekolah_id`, `sekolah_nama`, `kabupaten_kota_id`, `kabupaten_kota_nama`, `propinsi_id`, `propinsi_nama` );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment