How to deploy Project with Mysql Connector

leulae

Member
Joined
Aug 31, 2009
Messages
7
Programming Experience
Beginner
I created visual studio 2005 vb.net project, for back end I used Mysql 5 server.
I installed the mysql connector in development PC

It is working

I have to install this application in a LAN, there are 5 PC’s and One server for Mysql
My problem is it is not working when deploy to the other machines, Please guide me how to deploy my package

(My past projects with MSSql work well after deploy, I installed the .Net frame work and copy the exe file)

Thanks in advance

Leulae
 
The reason that your SQL Server projects worked is that the ADO.NET provider for SQL Server (System.Data.SqlClient) is part of the .NET Framework. If you install the .NET Framework then you've got the provider. As you know, you had to download and install the ADO.NET provider for MySQL (MySql.Data.MySqlClient), so it's obviously not part of the Framework. If your users don't get it from somewhere then the provider is missing and your app can't connect to the database. You have three choices:

1. Open the References for your project and set the Copy Local property of the MySql.Data.dll reference to True. When you next build your project, that assembly will be copied to the output folder, along with your EXE, and you can deploy it as part of your app. That makes it available to your app only.

2. Your users can get the Connector/Net package directly from you or from the MySQL web site and install it themselves. That makes it available to every .NET application.

3. If you're using an installer package to install your app (either ClickOnce or Windows Installer) then you can follow the instructions provided on MSDN for creating your own prerequisite package for Connector/Net. That will allow you to simply check that item in the Prerequisites dialogue for your installer, just as you do for the .NET Framework and other existing prerequisite packages, and it will be automatically included in your installer. Just note that you will then not be able to use the "Download from publisher's web site" option for prerequisites unless you include a publisher's web site address in the prerequisite. I'm guessing that you won't be using that option anyway.
 
Thank you very much for your valuable opinions and guide, Thanks lot

The reason that your SQL Server projects worked is that the ADO.NET provider for SQL Server (System.Data.SqlClient) is part of the .NET Framework. If you install the .NET Framework then you've got the provider. As you know, you had to download and install the ADO.NET provider for MySQL (MySql.Data.MySqlClient), so it's obviously not part of the Framework. If your users don't get it from somewhere then the provider is missing and your app can't connect to the database. You have three choices:

1. Open the References for your project and set the Copy Local property of the MySql.Data.dll reference to True. When you next build your project, that assembly will be copied to the output folder, along with your EXE, and you can deploy it as part of your app. That makes it available to your app only.

2. Your users can get the Connector/Net package directly from you or from the MySQL web site and install it themselves. That makes it available to every .NET application.

3. If you're using an installer package to install your app (either ClickOnce or Windows Installer) then you can follow the instructions provided on MSDN for creating your own prerequisite package for Connector/Net. That will allow you to simply check that item in the Prerequisites dialogue for your installer, just as you do for the .NET Framework and other existing prerequisite packages, and it will be automatically included in your installer. Just note that you will then not be able to use the "Download from publisher's web site" option for prerequisites unless you include a publisher's web site address in the prerequisite. I'm guessing that you won't be using that option anyway.
 
I created visual studio 2005 vb.net project, for back end I used Mysql 5 server.
I installed the mysql connector in development PC

It is working

I have to install this application in a LAN, there are 5 PC’s and One server for Mysql
My problem is it is not working when deploy to the other machines, Please guide me how to deploy my package

(My past projects with MSSql work well after deploy, I installed the .Net frame work and copy the exe file)

Thanks in advance

Leulae

i also try to develop project like ur project...make one system as mysql server..and other 5 system as client..
but it works only in server.....i use server name as localhost....is it wrong???plz help me....if u don't mind attach ur project ...it ll help me..
thanku..
 
i use server name as localhost
"localhost" refers to the same machine that the application is running on. If the database is on a different machine the you have to use the name of that server as the server name.
 
Back
Top