Click here to Skip to main content
15,919,898 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
i have created an application using visual studio c# connected with the database on MYSQL. Now i am at the app setup stage. I have one question does the person/client installing the application requires MYSQL? How can i attach MYSQL files to the application. Is there any way that a client can run the app without installing MYSQL.
Please help. I am new to this environment. please help
Posted

If you are using a MySql database in your application, then a MySQL database server needs to be accessible from each PC that is to run the app.

Normally, this would be installed separately by the user, as proliferating any database server is a bad idea.

If you are not using the database for multi-user access, then do not use a server based system (like MySql or Sql Server) - use a single user based database instead which does not require any additional installation. SqLite, SQLCE, or even Access are all fine.
 
Share this answer
 
Comments
DamithSL 14-Dec-14 5:28am    
MySql client/connector may need to install, it can be done using setup prerequisites
Helen Jess 14-Dec-14 5:29am    
Hai thanks for the replyHow can i add server client model setup to my project? I onlyused a workbench for the databases. Please help
Hi,

You have at least 3 choices:
1. Install MySQL DB server on client's computer
2. Install MySQL DB server on client's computer located within his Local Area Network
3. Use MySQL DB server installed on external hosting and connect via internet

Chosing first or second option is good if your app will be used by one or more users on LAN without access from internet.
Third option is good if you are planning to connect to database over internet from different offices not located within one network.

IMO best option to deploy database is by creating install scripts and generate database from that script while installing your app or on app's first run. As far as I know you can use MySQL Workbench application to generate that script (link below) or PHPMyAdmin.

Link:
http://dev.mysql.com/doc/workbench/en/index.html[^]

[Update for a comment]
It depends on how you know how to connect to MySQL server. If you provided connection info (host/dbname/user/pass) inside your code you will have to modify your application. You can add configuration window to allow user enter connection configuration and then store it in configuration file. On app startup read that file and dynamically build you database connection string. If configuration file is missing or connection info is not present in that file you can display DB configuration window and not let user run your app until he provide necessery data. Remember to encrypt DB password in configuration file!

I hope it help you.
 
Share this answer
 
v2
Comments
Helen Jess 14-Dec-14 5:31am    
thanks.Do i need to change my program for a server client setup?
Marcin Kozub 14-Dec-14 5:56am    
I've updated my answer.
Helen Jess 14-Dec-14 7:15am    
Thank you
Marcin Kozub 14-Dec-14 7:33am    
You're welcome. It would be nice to accept solution if it help you.
Helen Jess 14-Dec-14 18:10pm    
Many thanks Marcin. I tried the second option and that works now going to do the third one.

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