tags:

views:

22

answers:

1

Is possible? I plan to backup mysql database using vb.net. If you know any beginner tutorial on how to do this, then please let me know.

+1  A: 

If I understand the question correctly, you want to start mysql.exe from VB.Net and supply some command-line parameters to tell it what to do (in your case, do a database backup). (FWIW, you might be better off using mysqldump.exe for that.)

You can start any process via the System.Diagnostics.Process.Start method. You'll probably want either this variant that gives you full control over the startup, or this one that just lets you specify the process (EXE) name and arguments. Here's a page with lots of examples. They're in C#, but it shows using these methods; the syntactic differences don't (I suspect) get in the way much.

Off-the-cuff example:

Imports System.Diagnostics

Process.Start("mysqldump.exe", "myDatabaseName")
' Or include the path:
Process.Start("C:\Program Files\MySQL\MySQL Server\bin\mysqldump.exe", "myDatabaseName")
T.J. Crowder