I use this query for loading sql data from my pc to localhost mysql database.(version 5.0.10 working witj XAMPP)
The query is as below:
cmd = new MySqlCommand("LOAD DATA LOCAL INFILE '" + filename + "' IGNORE INTO TABLE " + tblname + " CHARACTER SET UTF8", conn);
And I tried this also (enclosed tblname)
cmd = new MySqlCommand("LOAD DATA LOCAL INFILE '" + filename + "' INTO TABLE `" + tblname + "` CHARACTER SET UTF8", conn);
And one line of my sql data (loaded without problem by phpmyadmin) :
INSERT INTO `atelier` VALUES(1,'Chateau Carbonnieux -1','26.12.2013 00:00:00',23,10,0,'4 macarons differents','mamie','15.12.2013 11:09:14','sabrina','18.12.2013 05:29:26');
The variable filename is : "E:\Macdata\20131228\atelier.sql" (with double backslah)
And the tblname is the table name read directly form database is: "atelier".
When the program reaches the line cmd.ExecuteNonQuery() 30 seconds after i get "Error 0 fatal error ecountered attempting to read the resultset."
This data file is loaded without problem with phpmyadmin.
What can be the reason ? MySql version ? Any help ?
As I'am a newbie in mysql, i used this link for creating my query command. Often they send this link for answer. But in this link there is no remarq to enclose the filename with ' otherwise it does not work it gives an error. http://dev.mysql.com/doc/refman/5.1/en/load-data.html