0

Hie everyone I have the below code on my console to import data from an excel sheet to a mySql database but unfortunately I am having an error which reads:

NO CONNECTION TRYING TO RECONNECT....
ERROR 2005 (HY000): UNKNOWN MYSQL SERVER HOST '(ID,NAME):' (11001)
ERROR:
Can't connect to the server

My command is as follows:

LOAD DATA LOCAL INFILE C:\\temp\\test.csv' INTO TABLE bd_george.test FIELDS TERMINATED BY;' LINES TERMINATED BY `\r\n' (id,name);

2
Contributors
2
Replies
20
Views
4 Years
Discussion Span
Last Post by gtsiga
1

I'm not sure if you're using a backtick at the end of the command to wrap \r\n, you have to use single quotes instead, so the correct command should be:

LOAD DATA LOCAL INFILE 'C:\\temp\\test.csv' INTO TABLE bd_george.test FIELDS TERMINATED BY ';' LINES TERMINATED BY '\r\n' (id,name);

Bye.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.