Created
October 26, 2021 15:47
-
-
Save thedarsideofit/8c85c94e7ee76a77839dd2a67cbe3ece to your computer and use it in GitHub Desktop.
Import from CSV File to MySQL
This file contains hidden or 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
-- 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