Tag Archives: Restore MYSQL Database via VB.NET

restore on remote server mysql database using

if you want to restore mysql database on remote sever or network deploy server then this code very help you.i also wast lot of time for that at the end this solution resolve my problem.

1. Just Add Remoter Sever Name/IP   -h192.168.10.40

2. In WorkingDirectory  give your Install Dir mysql Path.

3. E:\db\mpostest.sql you can use Filediaglog for dynamic path

4. You must create Empty db with name mpostest  in mysql for testing else give your orignal db name

Dim myProcess As New Process()
myProcess.StartInfo.FileName = “cmd.exe”
myProcess.StartInfo.UseShellExecute = False
myProcess.StartInfo.WorkingDirectory = “C:\wamp\bin\mysql\mysql5.6.12\bin\”
myProcess.StartInfo.RedirectStandardInput = True
myProcess.StartInfo.RedirectStandardOutput = True
Dim myStreamWriter As StreamWriter = myProcess.StandardInput
Dim mystreamreader As StreamReader = myProcess.StandardOutput
myStreamWriter.WriteLine(“mysql -u root -h192.168.10.40 -proot mpostest < E:\db\mpostest.sql “)
Catch ex As Exception

End Try

***** Also you can find Article on Local db & Backup mysql db(which resolve issue of blob , time,timespan type issue).because mostly backup article give Error for these type.

1 Comment

Posted by on January 28, 2014 in My SQL