Bug #69951 Visual Studio 2010 win 64 bits unable connect to MySql server, no databases
Submitted: 7 Aug 2013 12:21 Modified: 6 Jul 2016 12:45
Reporter: Maria Fuchs Email Updates:
Status: No Feedback Impact on me:
None 
Category:Connector / NET Severity:S2 (Serious)
Version:6.5.6 OS:Windows (win7 64bits)
Assigned to: Assigned Account CPU Architecture:Any
Tags: visual studio 2010

[7 Aug 2013 12:21] Maria Fuchs
Description:
Local I have the MySql database and can connect with MySqlWorkbench. 

In Visual Studio 2010 SP1 I try to make a server Explorer-Data-Connection with 'MySQL Database (MySQL Data Provider)' and fill in servername, username and password. 
Then on database name a get the message 'Unable to retrieve the list of databases' and an empty list is shown.

I have also tried connector net 6.7.4, but than on a click the window 'add connection' in VS2010 disappears. 

Win7 64 bits was a new installation.

How to repeat:
win7 64bits
Install VS2010 and SP1
Install MySQL server 5.6.13.0
Install MySql connector odbc 5.2.5 winx64
Install MySql connector net 6.5.6
[9 Aug 2013 21:53] Fernando Gonzalez.Sanchez
If you get the 'no databases to be shown' verify
a) That your credentials are valid and can access a database
b) Try typing 'mysql' (without apostrophes) as the database name (that database always exists).

One limitation of Connector/NET for Visual Studio is that you cannot create a new database from there (first you'll need to create in Workbench or other client tool), alternatively you can use pure SQL, after you have a conection in server explorer for 'mysql' open a query window an issue a 'create database <your-db-name>'.

If you try Connector/NET 6.7.4, be sure to install MySql for Visual Studio from MySql Windows Installer (because 6.7.x no longer includes any integration with Visual Studio).
[12 Aug 2013 15:11] Maria Fuchs
Hi Fernando

For other reasons I have upgraded Visual Studio 2010 to 2012.
There I have even more problems.
I don't have the selection 'MySQL Database (MySQL Data Provider)' !!!
I only can connect with ODBC !

Question 1:
How can I get a direct 'MySQL Database (MySQL Data Provider)' selection in VS2012?

For the ODBC-connection I have also installed Install MySql connector odbc 5.2.5 32bits

I have conncetion with ODBC when running from VS2012. 
When a publish the website, the connection is OK.

But when I want to make a SQLDataSource and 'configer data source' in the designer VS2012 I can select the DSN-name, but clicking on 'Next' VS2012 is not responding anymore.
The same problem is when I make a new connection with 'an connection string'. 
Question 2:
How can I solve this problem?

Do I need to make 2 new bugs?

Regards
Maria
[12 Aug 2013 15:49] Fernando Gonzalez.Sanchez
Hi Maria,

If you are still using Connector/NET 6.5.6, you'll need to move to 6.6 (only 6.6 and upwards are compatible with VS2012, 6.5 is not).

So, either you install 
a) 6.6.5 or
b) 6.7.4 + MySql for Visual Studio

Regards.
[13 Aug 2013 6:44] Maria Fuchs
Hi Fernando,

Thanks for the quick response.
I have installed Connector/NET 6.7.4 + MySql for Visual Studio 1.0.2
Sorry for not mentioning.
It should work... but doesn't

Regards
[13 Aug 2013 16:36] Fernando Gonzalez.Sanchez
Hi Maria, two questions:
a) If you are using Visual Studio Express, then is not gonna work (Express is not supported, legal constraints from Microsoft on plugins for it).
b) If you installed some Visual Studio after the MySql for Visual Studio, then you 'll need to reinstall MySql for Visual studio (it does package registering for each Visual Studio version at install time).
c) If none of the above applies, then something got corrupted in installation (could be a bug from cnet/mysql vs plugin), in that case please check the contents of your machine.config files, it must have MySql provider registered, something like this (this setting is currently done by 'MySql for Visual Studio' and is actually using internally Connector/NET 6.6.5):

<system.data> 
<DbProviderFactories> 
<add name="Microsoft SQL Server Compact Data Provider 4.0" invariant="System.Data.SqlServerCe.4.0" description=".NET Framework Data Provider for Microsoft SQL Server Compact" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" /> 
. 
. 
. 
<add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.6.5.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" /> 
</DbProviderFactories> 
</system.data>
[14 Aug 2013 10:08] Maria Fuchs
Hi Fernando,

Thanks for your reaction.
I use VS2012 Professional, so that is not the problem.

But I dit install VS2012 after MySql. So I have reinstalled mysql-installer-community-5.6.13.1
And after that I can make a MySQL Database-connection in VS2012 !!
So that was the problem. THANKS VERY MUCH !!!

But I still have one problem.
When I try to make connection to the database in VS2012 using "Micorsoft ODBC Data Source" and I want to use a data source name (DSN), witch I can retrieve in the dropdown list, I get the error:
"Failed to call the ODBC driver connection utility".
Using "Ue connetion string" I don't know what to type in the connectionstring.

How can I fix this problem? 
I hope you can give me some information about this.

Regards
Maria
[14 Aug 2013 10:08] Maria Fuchs
Hi Fernando,

Thanks for your reaction.
I use VS2012 Professional, so that is not the problem.

But I dit install VS2012 after MySql. So I have reinstalled mysql-installer-community-5.6.13.1
And after that I can make a MySQL Database-connection in VS2012 !!
So that was the problem. THANKS VERY MUCH !!!

But I still have one problem.
When I try to make connection to the database in VS2012 using "Micorsoft ODBC Data Source" and I want to use a data source name (DSN), witch I can retrieve in the dropdown list, I get the error:
"Failed to call the ODBC driver connection utility".
Using "Ue connetion string" I don't know what to type in the connectionstring.

How can I fix this problem? 
I hope you can give me some information about this.

Regards
Maria
[6 Jun 2016 12:45] Chiranjeevi Battula
Hello Maria Fuchs,

Thank you for your feedback.
I tried to reproduce the issue at my end using Connector/ODBC 5.3.6 and Visual Studio 2013 (C#.Net) but not seeing any issues to connect MySQL databases.

Please try with below Configuring of Connector/ODBC and sample program.
https://dev.mysql.com/doc/connector-odbc/en/connector-odbc-configuration-dsn-windows-5-2.h...
https://dev.mysql.com/doc/connector-odbc/en/connector-odbc-examples-programming.html

Thanks,
Chiranjeevi.
[7 Jul 2016 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".