Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/apache-spark/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
还原Mysql数据库查询在ASP.NET、C中不起作用#_.net_Mysql - Fatal编程技术网

还原Mysql数据库查询在ASP.NET、C中不起作用#

还原Mysql数据库查询在ASP.NET、C中不起作用#,.net,mysql,.net,Mysql,我们正在使用Mysql.exe通过以下查询恢复数据库 string cmd ="-h" + ViewState["host"].ToString() + " " + "-u" + ViewState["user"].ToString() + " " + "-p" + ViewState["password"].ToString() + " " + ViewState["dbName"].ToString() + "<" + " " + Server.MapPath("BackupFi

我们正在使用Mysql.exe通过以下查询恢复数据库

string cmd ="-h" + ViewState["host"].ToString() + " " + "-u" + 
ViewState["user"].ToString() + " " + "-p" + ViewState["password"].ToString() + 
" " + ViewState["dbName"].ToString() + "<" + " " + 
Server.MapPath("BackupFiles/") + path;
string cmd=“-h”+ViewState[“host”]。ToString()+“”+“-u”+
ViewState[“用户”].ToString()+“”+“-p”+ViewState[“密码”].ToString()+

“”+ViewState[“dbName”]”。ToString()+“您正在传递额外的参数

尝试:


欢迎使用StackOverflow。请更新您的问题,以包含您收到的任何错误消息的信息。您对
cmd
变量做了什么?您正在启动一个新进程吗?请发布更多代码,并解释什么不起作用。亲爱的Will Hughes,感谢您的回复,实际上相同的cmd正在command pro中执行mpt,但在dotnet中我们没有收到任何错误Dar Meister,感谢您的回复,使用cmd变量我们正在启动新进程(mysql.exe)。同样的代码在命令提示符下工作,但在dotnet中没有执行,而且我们也没有收到任何错误。这是完整的代码,请帮助我。亲爱的Meister,感谢您的回复,这是完整的代码,请帮助我。String path1=Server.MapPath(“BackupFiles/”)+path;StreamReader file=new StreamReader(path1);string cmd=string.Format(@“C:\EXE\mysql.EXE-u{0}-p{1}-h{2}{3}<{4}),“'+ViewState[“user”].ToString()+”,“'+ViewState[“password”].ToString()+”,“+ViewState[“host”.ToString()+”,““+ViewState[“dbName”].ToString()+”,“,“+path1+”;
 ProcessStartInfo proc = new ProcessStartInfo(@"C:\Inetpub\wwwroot\TFGRS1\PostgresDLLS\mysql.exe", cmd);
 Process p = new Process();
 p.StartInfo = proc;
 p.Start();
 p.WaitForExit();