MySQL 数据源未出现在 Visual Studio 中
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/16879451/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
MySQL Data Source not appearing in Visual Studio
提问by Sefam
I just installed the ADO.NET connector from here http://dev.mysql.com/downloads/connector/net/
我刚刚从这里安装了 ADO.NET 连接器http://dev.mysql.com/downloads/connector/net/
Yet MySQL doesn't appear as a data source like it should. I tried restarting Visual Studio. It doesn't fix my issue. Did I install the wrong connector?
然而,MySQL 并没有像它应该的那样作为数据源出现。我尝试重新启动 Visual Studio。它不能解决我的问题。我是否安装了错误的连接器?
EDIT: STill nothing. I'm using Visual Studio Express For Desktop. Do I need to pay for the Ultimate edition to use a MySQL Data Source?
编辑:仍然没有。我正在使用 Visual Studio Express For Desktop。我是否需要为 Ultimate 版付费才能使用 MySQL 数据源?
采纳答案by stuzor
I was having the same problem just now. I solved it by uninstalling the latest Connector/NET drivers (6.7.4) and then installed the older drivers (6.6.5) and it works.
我刚才遇到了同样的问题。我通过卸载最新的 Connector/NET 驱动程序 (6.7.4) 解决了这个问题,然后安装了旧的驱动程序 (6.6.5) 并且它可以工作。
I am using Visual Studio 2010. I uninstalled the latest ones because I figured they were somehow related to .NET4.5, which I'm not able to use.
我使用的是 Visual Studio 2010。我卸载了最新的,因为我认为它们与 .NET4.5 有某种关系,我无法使用。
Edit:
编辑:
Supposedly another way is to register the MySql Connector with various Visual Studio versions (2010/2012/2013/2015...) during installation: Go to Modify Product Featuresand select all the relevant Visual Studio versions.
据说另一种方法是在安装过程中使用各种 Visual Studio 版本(2010/2012/2013/2015...)注册 MySql 连接器:转到修改产品功能并选择所有相关的 Visual Studio 版本。
回答by hsan
Stuzor and hexcodes solution worked for me as well. However, if you do want the latest connector you have to download another product. From the oracle website:
Stuzor 和 hexcodes 解决方案也适用于我。但是,如果您确实需要最新的连接器,则必须下载其他产品。从oracle网站:
Starting with version 6.7, Connector/Net will no longer include the MySQL for Visual Studio integration. That functionality is now available in a separate product called MySQL for Visual Studio available using the MySQL Installer for Windows (see http://dev.mysql.com/tech-resources/articles/mysql-installer-for-windows.html).
从 6.7 版开始,Connector/Net 将不再包含用于 Visual Studio 集成的 MySQL。该功能现在可在名为 MySQL for Visual Studio 的单独产品中使用,该产品使用适用于 Windows 的 MySQL 安装程序可用(请参阅http://dev.mysql.com/tech-resources/articles/mysql-installer-for-windows.html)。
回答by Paul
I found this on the MySQL support page for the Visual Studio connectors.
我在 Visual Studio 连接器的 MySQL 支持页面上找到了这个。
It appears that they do not support the MySQL to Visual Studio EXPRESS editions.
看来他们不支持 MySQL 到 Visual Studio EXPRESS 版本。
So to answer your question, yes you may need the ultimate version or professional edition - just not Express to be able to use MySQL with VS.
因此,要回答您的问题,是的,您可能需要终极版或专业版 - 只是不是 Express 才能将 MySQL 与 VS 一起使用。
http://forums.mysql.com/read.php?38,546265,564533#msg-564533
http://forums.mysql.com/read.php?38,546265,564533#msg-564533
回答by Josh C
From the MySql site.
Starting with version 6.7, Connector/Net will no longer include the MySQL for Visual Studio integration. That functionality is now available in a separate product called MySQL for Visual Studio available using the MySQL Installer for Windows (see http://dev.mysql.com/tech-resources/articles/mysql-installer-for-windows.html).
从 6.7 版开始,Connector/Net 将不再包含用于 Visual Studio 集成的 MySQL。该功能现在可在名为 MySQL for Visual Studio 的单独产品中使用,该产品使用适用于 Windows 的 MySQL 安装程序可用(请参阅http://dev.mysql.com/tech-resources/articles/mysql-installer-for-windows.html)。
回答by Jan
Tried everything but on Visual Studio 2015 Community edition I got it working when I installed MySQL for Visual Studio 1.2.4+ from http://dev.mysql.com/downloads/windows/visualstudio/At time of writing I could download 1.2.6 which worked for me.
除了 Visual Studio 2015 社区版之外,我尝试了所有方法,当我从http://dev.mysql.com/downloads/windows/visualstudio/为 Visual Studio 1.2.4+ 安装 MySQL 时,我开始工作了。在 撰写本文时,我可以下载 1.2。 6 对我有用。
Release notes of 1.2.4 which adds support for VS2015 can be found at http://forums.mysql.com/read.php?3,633391
可以在http://forums.mysql.com/read.php?3,633391找到增加对 VS2015 支持的 1.2.4 的发行说明
回答by Gernot Lepej
The Connector 6.7.x does not integrate the native data provider anymore. For "Visual Studio 2012" or less, you have to install "MySQL for Visual Studio". If you are using "Visual Studio 2013" there is no possibility to integrate MySQL for the "Entity Framework" yet. A solution should be available on 10/2013!
连接器 6.7.x 不再集成本机数据提供程序。对于“Visual Studio 2012”或更低版本,您必须安装“MySQL for Visual Studio”。如果您使用的是“Visual Studio 2013”,则尚无法为“实体框架”集成 MySQL。10/2013 应该有解决方案!
回答by Rajeshkumar
Uninstall later version and install mysql-connector 6.3.9 for visual studio 2010.
卸载更高版本并安装 mysql-connector 6.3.9 for Visual Studio 2010。
After installing add the dll files and restart the visual studio.
安装后添加dll文件并重新启动visual studio。
It works fine.
它工作正常。
回答by Buddhika Lakshan
I have faced the same problem and i have installed mysql-connector-net-8.0.11. But in visual studio is not showing the db connector for mysql. Then I was installed the mysql-for-visualstudio-1.2.8 and run the visual studio. Its working fine.
我遇到了同样的问题,我已经安装了 mysql-connector-net-8.0.11。但是在visual studio中没有显示mysql的db连接器。然后我安装了 mysql-for-visualstudio-1.2.8 并运行了visual studio。它的工作正常。
Thank you!
谢谢!
回答by user3175253
Just struggled with Visutal Studio 2017 Community Edition - none of above options worked for me. In my case what i had to do was:
只是在 Visutal Studio 2017 社区版中挣扎 - 以上选项都不适合我。就我而言,我必须做的是:
Run MySQL Installer and install/upgrade: Connector/NET and MySQL for Visual Studio to current versions (8.0.17 and 1.2.8 at the time)
Run Visual Studio Installer > Visual Studio Community 2017 > Modify > Individual components > add .NET Framework Targeting Packs for 4.6.2, 4.7, 4.7.1 and 4.7.2
Reopen project and change project target platform to 4.7.2
Remove all MySQL-related nuGET packages and references
Install following nuGET packages: EntityFramework, MySql.Data.Entity, Mysql.Data.Entities
Upgrade following nuGET packages: MySql.Data, BouncyCastle nad Google.Protobuf (for some reason there is an update available just after install)
运行 MySQL 安装程序并安装/升级:Connector/NET 和 MySQL for Visual Studio 到当前版本(当时是 8.0.17 和 1.2.8)
运行 Visual Studio Installer > Visual Studio Community 2017 > Modify > Individual components > add .NET Framework Targeting Packs for 4.6.2, 4.7, 4.7.1 and 4.7.2
重新打开项目并将项目目标平台更改为 4.7.2
删除所有与 MySQL 相关的 nuGET 包和引用
安装以下 nuGET 包:EntityFramework、MySql.Data.Entity、Mysql.Data.Entities
升级以下 nuGET 包:MySql.Data、BouncyCastle nad Google.Protobuf(出于某种原因,安装后有可用的更新)
回答by fmoradi9
i install mysql for visual studio and the problem simply solved.although version of my visual studio is 2012!
我为visual studio安装了mysql,问题就解决了。虽然我的visual studio版本是2012!