当我从VB.NET执行mysql数据库备份时,为什么会得到0KB文件? [英] Why do I get 0KB file when I perform a mysql database backup from VB.NET?

查看:185
本文介绍了当我从VB.NET执行mysql数据库备份时,为什么会得到0KB文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好!



我正在尝试从vb.net执行一个mysql数据库。我使用这段代码:

Hi all!

I''m trying to perform a mysql database from vb.net. I use this code:

Process.Start("C:\Program Files (x86)\MySQL\MySQL Workbench CE 5.2.44\mysqldump.exe", "--user=root --password=mypassword " _
& "--host=127.0.0.1 --databases MySQL databasename -r ""C:\GreatestHR Backup\BackUpDataBase.sql""")



当这段代码运行时,命令提示符窗口会打开并立即消失,我甚至无法阅读它所说的内容。当我转到代码中指定的输出文件夹时,实际上有BackupDatabase.sql,但只有0Kb,而实际的数据库中有数据。可能是什么问题?



我再说一遍,我在Mysql Workbenc 5.2中使用mysql数据库。


When this code runs, a command prompt window opens and goes away immediately that i can''t even read what it says. When I go to the output folder specified in the code, there is really BackupDatabase.sql but with only 0Kb, while the actual database has data in it. What could be the problem?

I repeat, I use mysql database in Mysql Workbenc 5.2.

推荐答案

可能有错误,你看不到它,因为窗户正在消失。而是,执行Start,Run,CMD以打开一个命令窗口,该窗口在完成该过程时不会关闭。粘贴在Process.Start字符串中的内容,看看会发生什么。
There is likely an error and you can''t see it because the window is going away. Instead, do Start, Run, CMD to open a command window that will not close when the process is done. The paste in what you have in the Process.Start string and see what happens.


这篇关于当我从VB.NET执行mysql数据库备份时,为什么会得到0KB文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆