Skip to content

Instantly share code, notes, and snippets.

@thedarsideofit
Created October 26, 2021 15:47
Show Gist options
  • Save thedarsideofit/8c85c94e7ee76a77839dd2a67cbe3ece to your computer and use it in GitHub Desktop.
Save thedarsideofit/8c85c94e7ee76a77839dd2a67cbe3ece to your computer and use it in GitHub Desktop.
Import from CSV File to MySQL
-- Go the CSVs path and then connect to the MySQL Server
mysql --user=YOURUSER --password=YOURPASSWORD --host=localhost --local-infile=1 YOURDATABASE
LOAD DATA LOCAL INFILE 'YOURFILENAME.csv'
INTO TABLE YOURTABLE
FIELDS TERMINATED by ','
LINES TERMINATED BY '\n';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment