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);

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.

Thanks a lot its now working cheers!!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.