7

As the title says, no matter what I do MySQL does not appear in the list of Data Sources in Visual Studio 2015.

I have done everything that is suggested in this question: MySQL Data Source not appearing in Visual Studio

I have also installed development releases and different versions of connectors with the corresponding MySQL VS drivers as per this table here: https://dev.mysql.com/doc/visual-studio/en/visual-studio-install.html

I have reinstalled Visual Studio itself.

All of this to no avail. I can manually configure the connection and run a .Net application that reads from and writes to MySQL but Visual Studio refuses to do anything with MySQL in the data source popup window.

Short of moving the database to SQL Server I am not sure what else can be done here.

Any suggestion or help to get this resolved would be great. I've been at this for the last 48 hours.

Currently installed versions: MySQL for Visual Studio - 1.2.7, Connector/Net - 6.9.9

This is for a .Net 4.5.2 based project.

Nico
  • 3,471
  • 2
  • 29
  • 40
  • I would recommend to get more answers that you include the versions of the drivers you are using and any other relevent versioning you have on your environment such as .NET. As it stands folks would have to take a guess to answer this. :-) – Shawn Aug 25 '17 at 17:19
  • @Shawn Thanks Shawn. Added the versions for .Net, the connector and MySQL for VS. – Nico Aug 25 '17 at 19:21

2 Answers2

1

I have had this same problem a while back. Unfortunately I think the answer is case by case, and I can't remember what exactly fixed it other than playing around with versions of MySQL Server and MySQL Connector/Net versions.

I have VS 2015 so I just tried to recreate this problem. I was unable to do so as I installed MySQL for VS 1.2.7 and Connector/Net 6.9.9 and was able to see MySQL Database as an option in the Data Sources window.

I recommend uninstalling both MySQL for VS and your Connector/Net 6.9.9 and then reinstalling them. Make sure you install MySQL for VS before Connector/Net as the documenation you linked in your question says "Always install MySQL for Visual Studio before installing MySQL Connector/Net."

You might also try using MySQL community server instead of MySQL for VS and using an older version of Connector/Net.

Update

Try doing the following:

  1. Uninstall MySQL for VS and Connector/Net.
  2. Install Connector/Net 6.9.9 by doing a custom installation. Remove the Web providers feature from the installation and continue with installation.
  3. Install MySQL for VS 1.2.7 by doing a custom installation. Make sure that the Visual Studio Integration feature is selected for installation and finish installation (It should be selected by default).

Update 2

If you want more alternatives to reinstalling:

Try checking out your machine.config file properties to see if the MySQL Data Provider property is similar to mine by going to C:\Windows\Microsoft.NET\Framework\v2.0.50727\CONFIG

Lines to check:

  • ltsadd name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.9.9.0, Culture=neutral, PublicKeyToken=XXXXXXXXX" /gts

Also, maybe try a creating a website instead of a project or vice versa. There are multiple ways to get to the Data Source window. You could try creating an ADO.Net object and adding a connection to see if that data source window displays MySQL as a data source. You can also create a connection through the server explorer window. Just follow these steps.

Community
  • 1
  • 1
Kyle Scott
  • 64
  • 4
  • Uninstalled both various times and tried different versions as well. Tried the community server method too but to no avail. Even uninstalled VS and reinstalled it. Short of reinstalling Windows, not sure what else to do. – Nico Aug 28 '17 at 03:05
  • Followed your update. Still doesn't work. Might have to do a Windows 10 reinstall. – Nico Aug 29 '17 at 20:32
  • Yeah, I'd hope a Windows reinstall would fix it. – Kyle Scott Aug 29 '17 at 21:53
  • Checked the line that you suggested in all instances of the Framework install and it is like this: `` I am failing to understand why this issue's even occurring. – Nico Aug 30 '17 at 19:31
  • 1
    Yeah I am failing to understand too. I would have thought that after trying all the steps you have tried and even reinstalling visual studio, something would have worked. Maybe you could try a different version of Visual Studio if possible. It could be possible the version you use does not support MySQL as a data source. If you know it does, maybe go ahead and do a Windows reinstall then. – Kyle Scott Sep 01 '17 at 14:12
1

Install the last NuGet version of:

MySql.Data
MySql.Data.Entity

Close and re-open visual studio

Choose ADO Entry Data Model

New Connection

On the right of data source, edit button

On the new window you will find MySQL Database

Marco Salerno
  • 5,131
  • 2
  • 12
  • 32