C#コードを使用して、ダンプファイルからMySQLデータベースのデータを復元しようとしています。C#MySQLデータベースのリストア
私は、次のコマンドを実行すると仮定しています: mysqlの--verbose --user =ルート--password = qwerty123456テスト< C:Users \ユーザーデフォルト\ testing.SQL
\私はC#は」doesnのことを知っています"<"という記号を認識するので、いくつかの方法を試しましたが、それでも機能しませんでした。誰も私にこれを助けることができますか?私はすべてのデータベースデータをC#コードを使ってMySQLに戻したいと思っています。
ありがとうございます。あなたは、単にUseShellExecute = true
を設定している場合
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