开发者

Restore Mysql database query is not working in ASP.NET, C#

开发者 https://www.devze.com 2023-02-01 12:50 出处:网络
We are using Mysql.exe to restore database by the following query string cmd =\"-h\" + ViewState[\"host\"].ToString() + \" \" + \"-u\" +

We are using Mysql.exe to restore database by the following query

string cmd ="-h" + ViewState["host"].ToString() + " " + "-u" + 
ViewState["user"].ToString() + " " + "-p" + ViewState["password"].ToString() + 
" " + ViewState["dbName"].ToString() + "<" + " " + 
Server.MapPath("BackupFiles/") + path;

The same query is executing in MySql command prompt but we are not able to restore using the 开发者_运维问答above query in VisualStudio .Net, we have tried MysqlImport.exe to do the restore but it was no use. we are newbie to MySql if any help would be appreciated.


you are passing extra parameters

Try:

 ProcessStartInfo proc = new ProcessStartInfo(@"C:\Inetpub\wwwroot\TFGRS1\PostgresDLLS\mysql.exe", cmd);
 Process p = new Process();
 p.StartInfo = proc;
 p.Start();
 p.WaitForExit();
0

精彩评论

暂无评论...
验证码 换一张
取 消