当我尝试备份mysql数据库时,我没有得到ExportToFile
而是在显示为注释语句的行中显示导出。我怎么能做到这一点?
这是我的代码:
private void Backup()
{
string constring = "server=localhost;user=root;pwd=;database=testdb;Allow Zero Datetime=true";
string file = "D:\\sss.sql";
MySqlConnection conn = new MySqlConnection(constring);
MySqlCommand cmd = new MySqlCommand();
MySqlBackup mb = new MySqlBackup(cmd);
cmd.Connection = conn;
conn.Open();
mb.Export(file); //mb.ExportToFile//
conn.Close();
}