简体   繁体   中英

How I can use mysql.exe in VB.NET

I want to restore an simple .SQL file,

The MySQL Server is Protected with password and is an remote Host

I solved my Problem using this:

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()

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM