15
votes

I would like to create a EF model using a MySQL database. I am running VS2012 and VS2013 on a 64 bit machine. What do I need to install to get MySQL to show up in the Entity Data Model Wizard when it's time to add a new connection ? I tried adding MySQL.Data.Entities Nuget package, but I still do not get the option in the wizard. When searching for MySQL .NET Connector, I only find 32 bit downloads. Please advise.

Thanks

enter image description here

UPDATE:

I ran the MySQL installer again and noticed the MySQL for Visual Studio was not installed. I ran it again and get an error. Here is the end of the install details:

1: File: license-zlib-net.html, Directory: C:\Program Files (x86)\MySQL\MySQL for Visual Studio 1.0.2\Documentation\Licenses for Third-Party Components\, Size: 17171 1: Action 6:09:56: ManagedDataInstall. Registering data provider in machine.config 1: Action 6:09:56: Rollback. Rolling back action: 1: Registering data provider in machine.config 1: Copying new files 1: Creating folders 1: Updating component registration 1: 1: MySQL for Visual Studio 1.0.2 2: {0D406BCC-D62A-46FB-9AB7-A7BF10FB8B31} 3: 3 1: 1: Final actions. 1: Install error

I can paste the entire contents of the details, but was hoping there is enough information. Does this offer any clues ? It almost looked like the install was having trouble modifying the machine.config files, but I changed the security on these files by adding "Everyone" to have read and write permission (temporarily).

6
Use the 32 bit version. - Mihai
Tried that. Same error. - Bill Greer

6 Answers

16
votes

For Visual Studio 2013 environment, download and install MySQL for Visual Studio 1.1.1 from the link below then you will be able to see MySQL Data Provider in Data Source list.

https://cdn.mysql.com/Downloads/MySQLInstaller/mysql-visualstudio-plugin-1.1.1.msi

2
votes

Visual Studio 2013 Express cannot be used with MySQL for visual Studio according to the following article: http://dev.mysql.com/doc/connector-net/en/connector-net-visual-studio-install.html

In the Requirements section the above article mention that:

Requirements
MySQL Connector/Net supports full versions of Visual Studio 2008 and later, although the extent of support is based on your installed versions of MySQL Connector/Net and Visual Studio:

Visual Studio 2013 (***Professional edition and up only***) is supported by MySQL Connector/Net 6.8 and up with the MySQL for Visual Studio product.

Visual Studio 2012 is supported by MySQL Connector/Net 6.7 with MySQL for Visual Studio, and by MySQL Connector/Net 6.6 with the older Visual Studio Plugin.

Since you are using Express version, that may be the porblem.

1
votes

You need to download and install MySql Installer. The link is: http://dev.mysql.com/downloads/windows/installer/. For Visual Studio : http://www.mysql.com/why-mysql/windows/visualstudio/

1
votes

Strange, I have it in my Visual Studio 2012. I installed mysql-installer-web-community-5.6.15.0.msi, and selected MySql for visual Studio!enter image description here

1
votes

For you to see MySql provider you need both to install MySQL Connector/NET 6.7.x and MySQL for Visual Studio 1.0.2.

Or the latest versions MySql Connector/NET 6.8.3 and MySql for Visual Studio 1.1.3.

Bear in mind that if you install Connector/NET thru nuget, it will not register in the machine.config (so is more limited that way).

0
votes

If someone using Visual Studio 2013 and having the same issue when using mysql with entity framework.

Download MySQL for Visual Studio 1.2.7. and Connector/NET 6.7.5, 6.8.3 or 6.9.x.

Which will resolve your issue.

Make sure you have system.data and system.data.entity in your reference to the project.