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