3
我正在嘗試使用C#代碼從轉儲文件恢復MySQL數據庫數據。C#MySQL數據庫恢復
我想執行以下命令: MySQL的--verbose --user =根--password = qwerty123456測試< C:\用戶\默認\ testing.SQL
我知道C#沒有按」不承認「<」符號,所以我嘗試了幾種方法,但仍然無效。任何人都可以幫助我嗎?我想使用C#代碼將所有數據庫數據恢復到MySQL中。
在此先感謝。
Process process = new Process();
process.StartInfo.FileName = @"C:\Program Files\MySQL\MySQL Server 5.1\bin\mysql.exe";
process.StartInfo.Arguments = @"--verbose --user=root --password=qwerty123456 test";
process.StartInfo.UseShellExecute = false;
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.RedirectStandardInput = true;
process.StartInfo.RedirectStandardError = true;
process.StartInfo.CreateNoWindow = true;
process.Start();
StreamReader sr = process.StandardOutput;
sr = File.OpenText(@"C:\Users\Default\testing.SQL");
謝謝!有用。 – athgap 2010-12-15 08:16:39