RSS

restore on remote server mysql database using vb.net

28 Jan

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
myProcess.Start()
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 “)
myStreamWriter.Close()
myProcess.WaitForExit()
myProcess.Close()
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.

Advertisements
 
1 Comment

Posted by on January 28, 2014 in My SQL

 

Tags:

One response to “restore on remote server mysql database using vb.net

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: