誰かに役立つ場合は、次の方法で問題を修正しました。
public static void MySqlCSVImport(string Filename, string Table, string Server, string Database, string User, string Password, string Port)
{
try
{
//enclosed by '"'
string FixFilePath = Filename.Replace(@":\", ":\\");
string c = "'" + "\\n" + "'";
string d = ";";
string connectionString = "server=" + Server + ";database=" + Database + ";User Id=" + User + ";password=" + Password + "";
MySqlConnection mySqlConnection = new MySqlConnection(connectionString);
mySqlConnection.Open();
string Query = "load data local infile" + " " + "'" + FixFilePath + "'" + " " + "into table" + " " + Table + " FIELDS TERMINATED BY ',' ENCLOSED BY '\"' LINES TERMINATED BY" + " " + c + d;
MySqlCommand cmd = new MySqlCommand(Query, mySqlConnection);
cmd.ExecuteNonQuery();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}