C# and mysqldump

后端 未结 1 1736
梦谈多话
梦谈多话 2021-01-28 14:12

I\'m writing an application which should make a complete copy of one database and then import it on the same server with different name.
So, I guess I should use mysqldump

1条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-28 14:57

    You have two choices:

    • Do not redirect the output of mysqldump in the command line, but use a more verbouse process creation and hook the standard output of mysqldump. This makes ist possible to postprocess the file (Hash it as an example) and either write it out to where you want, or run it directly into the standard input of the importing instance.
    • Understand, that > C:\\Documents and Settings\\admin\\Desktop\\databases\\db.sql is not a command line parameter. You need to sssemble and the parameter and redirection part string and use shell execution. Make sure, you use an absolute path name.

    0 讨论(0)
提交回复
热议问题