Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

import csv file to mysql remote server using mysqlimport

I have 4 csv files that I want to import into my AWS mysql database.

I am trying to use the following command from a windows machine:

"C:\Program Files\MySQL\MySQL Server 5.7\bin\mysqlimport.exe" -h myhostname.amazonaws.com -P 3306 -u admin -pmypassword --local --fields-terminated-by=, --lines-terminated-by="\r\n" ticketsdb tickets "Data_2014_1.csv"

The response that I get is this:

mysqlimport: [Warning] Using a password on the command line interface can be insecure.
mysqlimport: Error: 2, File 'tickets' not found (Errcode: 2 - No such file or directory), when using table: tickets
like image 558
Dannyvas Avatar asked Dec 02 '25 22:12

Dannyvas


1 Answers

Do you actually have a file named "tickets" that you are trying to import? It sort of looks like you are trying to pass in a table name. Based on the documentation, I think you need to rename Data_2014_1.csv to tickets.csv and then run the following command:

"C:\Program Files\MySQL\MySQL Server 5.7\bin\mysqlimport.exe" -h myhostname.amazonaws.com -P 3306 -u admin -pmypassword --local --fields-terminated-by=, --lines-terminated-by="\r\n" ticketsdb tickets.csv

like image 193
Mark B Avatar answered Dec 05 '25 14:12

Mark B



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!