Click here to Skip to main content
15,923,909 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello Friends,
I am using vb.net with mysql. I want to restore .sql file mysql on click button. I have created backup of database but i am not restoring database. Because when we execute "Process.Start("C:\Program Files\mysql\mysql server 5.0\bin\mysql.exe", "--opt --host=localhost --password=test -user=root --database test < -r '" & TextBox1.Text & "'")"
this code it can not create "db.opt" file. So please send me a solution of this problem.
Thanks.
Posted
Updated 30-Jun-10 2:06am
v2

1 solution

Using Process.Start to run MySQL or MySQLDump is a really tricky way to go about this. When backing up and restoring MySQL databases from a .Net application the best bet is to do the work yourself. Take a look at my article on Backing up MySQl databases Here[^]. It includes a full backup and restore class which you can use directly in your .Net app.

Happy Coding
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900