views:

23

answers:

1

Hello,

I my software (coded in C# .NET ) I need the client to install a database server (MySQL in my case). I'm deploying the setup and making user install it like a pre-requisite.

After installing the DBMS server. I need to setup databases (that I created) on the client machine. How to do this automatically (as part of installation.)?

+1  A: 

if you know username and password, you can run cmd to restore database from dump file

mysql -u #username# -p #database# < #dump_file#
volody
you check this link for implementation http://www.dotnetspider.com/resources/19537-MySQL-Database-Backup-Restore-from-C-NET.aspx
volody
@volody: Thanks. What if I have some BLOB data? (Images are also stored in Database). I know the disadvantages of using it But I have to. Will this method work even then?
claws
I have used BLOB to store documents in the past, but I don't remember any issue with using restore. It could take some time, depends on size of backup file. Definitely, it is not a good idea to run sql select statement with blob in Query Browser -> response time could be substantial.
volody