RSS

Restore on Local Mysql Database through vb.net

28 Jan

if you want to restore mysql data on local mysql database then use below code.

1. Just Change “C:\wamp\bin\mysql\mysql5.6.12\bin\ ” path url according to your install wamp sever or mysql sever.

2. Backup file or script data path…… E:\db\mpostest.sql

3. “mpostest”  mysql database name

 

Try

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  -proot mpostest < E:\db\mpostest.sql “)
myStreamWriter.Close()
myProcess.WaitForExit()
myProcess.Close()
Catch ex As Exception

End Try

 

You can also  find here article  restore mysql database on remote or network sever

 

https://humrahimcs.wordpress.com/2014/01/28/restore-on-remote-server-mysql-database-using-vb-net/

Advertisements
 
Leave a comment

Posted by on January 28, 2014 in My SQL

 

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: