我正在嘗試備份一個mysql數據庫。 我正在創建的代碼是使用C的MySQL數據庫備份#
ProcessStartInfo proc = new ProcessStartInfo();
string cmd = string.Format(@"-u{0} -p{1} -E -R -h{2} {3}", UserName, PWD, hostname, dbname);
proc.FileName = "Path to mysqldump.exe";
proc.RedirectStandardInput = false;
proc.RedirectStandardOutput = true;
proc.Arguments = cmd;
proc.UseShellExecute = false;
Process p = Process.Start(proc);
string res;
res = p.StandardOutput.ReadToEnd();
file.WriteLine(res);
p.WaitForExit();
file.Close();
的問題是它正常工作時的數據庫大小雖小,但我得到Out Of Memory Exception
當我試圖把備份大型數據庫(大約800 MB)的。
錯誤消息解釋了許多things.How多大的空間,你有在C盤確定備份操作的空間在進行備份或任何curd內存管理時使用臨時內存。 – Pratik
@Ptik約有64 GB的可用空間.. – Rakesh
讀取數據庫文件的方法可以ü發佈樣本,因爲這可能是原因 – Pratik