简体   繁体   English

Visual Studio无法连接到正确版本的MySql Server

[英]Visual Studio not connecting to the correct version of MySql Server

I have an installation of MySql Server 5.0 which I may not uninstall. 我安装了MySql Server 5.0,但可能无法卸载。 However Visual Studio 2017 does not like this version, so I've managed to install MySql Server 8.0 (using the community installer 8.0.14). 但是Visual Studio 2017不喜欢此版本,因此我设法安装了MySql Server 8.0(使用社区安装程序8.0.14)。

I have installed the MySql for Visual Studio 1.2.8 using the installer as well, and as far as connectors/net go, I have tried 8.0.15, 6.10.8 and 6.9.12 (with 6.9.12 having the most luck in initially connecting and generating an entity framework model, but something has broken since). 我也使用安装程序安装了MySql for Visual Studio 1.2.8,就连接器/网络而言,我尝试了8.0.15、6.10.8和6.9.12(其中6.9.12运气最大)最初连接并生成了一个实体框架模型,但此后出现了问题)。

The MySql CL still recognizes MySql 8.0 and the database is there and fine, but VS refuses to see or use that version, and instead what's to use MySql 5.0 MySql CL仍然可以识别MySql 8.0,并且数据库很好,但是VS拒绝查看或使用该版本,而是拒绝使用MySql 5.0

There is nothing with EF here. EF这里没有任何东西。 You need to use correct MySql Driver in order to connect with your DB. 您需要使用正确的MySql驱动程序才能与数据库连接。 You can connect to Mysql version 5.5+ with EF using MySql Connector/NET 您可以使用MySql Connector / NET通过EF连接到Mysql 5.5+版本

Requirements for EF6 Connector/NET 6.10.x or 8.0.x EF6 Connector / NET 6.10.x或8.0.x的要求

  • MySQL Server 5.5 or higher MySQL Server 5.5或更高版本

  • Entity Framework 6 assemblies 实体框架6程序集

  • .NET Framework 4.0 or higher (.NET Framework 4.5.1 or higher is required for Connector/NET 6.10 and 8.0) .NET Framework 4.0或更高版本(连接器/ NET 6.10和8.0需要.NET Framework 4.5.1或更高版本)

Reference 参考

So after much fiddling, I found out after this morning's reboot, the version 5 service had restarted and somehow took preference over version 8's one. 因此,经过一番摆弄之后,我发现今天早晨重新启动后,版本5服务已经重新启动,并且以某种方式优先于版本8的服务。 Stopping it solved the issue. 停止它可以解决问题。 (And I've discovered I could probably have used v5... Key word, probably.) (而且我发现我可能使用过v5 ...可能是关键词。)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM