How do you create a database backup of a mysql database in VB.Net?
+1
A:
you could invoke mysqldump, but you may need to be running your VB.NET on the Mysql server.
Osama ALASSIRY
2008-10-10 08:21:23
A:
I would write a stored proc, since MySQL 5 has support for them, that handles all the data "heavy" work. Then just create scheduled task that calls the procedure every "night". For this latter component, I highly recommend Powershell....its awesome.
websch01ar
2008-10-29 21:37:12
+1
A:
I found the easiest way was to use the mysqldump.exe which is a standalone application.
mysqldump --host=[HOSTNAME] --user=[USER] --password=[PASSWORD] -R [DATABASE NAME] > [PATH TO BACKUP FILE]
We had issues with backups not saving db functions but the -R switch sorted it so id recommend using it if you use stored procedures or functions in your DB.
to restore the created file use the mysql command instead.
mysql --host=[HOSTNAME] --user=[USER] --password=[PASSWORD] [DATABASE NAME] < [PATH TO BACKUP FILE]
Kaius
2008-11-01 23:48:55