我如何在VB.NET中使用mysql.exe

时间:2012-05-24 22:15:49

标签: mysql windows vb.net mysqlimport

我想恢复一个简单的.SQL文件,

MySQL服务器受密码保护,是一个远程主机

1 个答案:

答案 0 :(得分:0)

我用这个解决了我的问题:

Dim proc As New Process
            proc.StartInfo.FileName = "cmd.exe"
            proc.StartInfo.UseShellExecute = False
            'Don’t show command prompt window.
            proc.StartInfo.CreateNoWindow = True
            proc.StartInfo.Arguments = "/K bin\mysql.exe -h " & db_host_int & " -u " & db_user_int & " -p" & db_password_int & " " & db_database_int & " < bin/DB_SCHEMA.sql"
            proc.Start()
            'Time in milliseconds, can change value to wait.
            proc.WaitForExit(1000)
            proc.Close()