Reputation: 337
I have a winform application written in C#. My database stands in MySql. Now i wanted it to deploy on other machines without having to install mysql individually/saperately on each machine. Please suggest me ways i could include my MySql database with the application in one installer without having to install mysql on each machine. Alternatively if its not possible in MySql i could migrate it in Sqlite. Please point me to relevant resources.
I have seen similar questions on this board before but none of them was clear in their solutions.
Thanks
Upvotes: 2
Views: 5345
Reputation: 2466
If I understand your question you could use the "Prerequisites in Windows Installer Deployment"
So you add mysql installer as prerequisities and after you can install your application and execute the script for the Database creation and other resource like Table, Views and Stored Procedure.
This tutorial can help you on the second step.
Upvotes: 1
Reputation: 726
When faced with a similar situation I simply included a MySQL distribution with the application (this was for internal purposes, you may need a license to distribute MySQL commercially).
Here's what I did:
{app_folder}\mysql\bin\mysqld.exe --defaults-file="{app_folder}\my.ini"
. To stop MySQL I used: {app_folder}\mysql\bin\mysqladmin.exe -u youruser -p yourpassword shutdown
. You could have your application check if MySQL is running and start it if not.This might not be the best solution since anyone could easily access the database. Also I cannot confirm if this would work with the current versions of MySQL (you may need to specify the data folder in the configuration file). If the database is only used by your application SQLite might be a better option.
Upvotes: 2