I need to import.csv file throught windwos command line terminal in defined table.

I trying this command :

C:\xampp\mysql\bin\mysql -u root -p dbname dbtablename < C:\xampp\htdocs\site\csvfolder\import.csv

but it does not works. What i am doing wrong ?


I believe you have to use LOAD DATA INFILE for csv files. See here: https://dev.mysql.com/doc/refman/5.7/en/load-data.html.

You can run it from the command line like so:

mysql -u root dbname -p -e "load data infile 'c:/path/to/file.csv' into table dbtablename"
  • so there is no terminal solution...need to work in mysql anyway ? – John Oct 15 '17 at 19:23
  • Try: mysql -u root -p dbname -e "load data infile 'c:/path/to/file.csv' into table dbtablename". I edited my answer to include this. – Joe Oct 15 '17 at 19:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.