Entity Framework's Entity Data Wizard Crashes When Connecting to MySQL Database

后端 未结 5 2254
攒了一身酷
攒了一身酷 2021-02-11 22:46

I am attempting to create an Entity Data Model using the wizard to reverse engineer an existing MySQL database. I get to the Choose Your Data Connection page of the wizard, sele

相关标签:
5条回答
  • 2021-02-11 23:22

    This keeps happening with VS2017 and the latest MySQL connector (6.10.6). Downgrading both the connector and the Nuget package to 6.9.11 works.

    0 讨论(0)
  • 2021-02-11 23:28

    I faced the same issue it was because I was using Mysql connector v 8.0.12 ,MySql.Data v8.0.12 and Mysql.Data.Entity v6.10.8.

    The program crashes because of compatibility issues.What worked for me is I installed all three of the same version

    Mysql connector v 6.10.8 and MySql.Data v6.10.8 and Mysql.Data.Entity v6.10.8.

    0 讨论(0)
  • 2021-02-11 23:39

    It is caused by version mismatch.

    On my system, I had MySQL Connector 6.9.6. Issuing the command in NuGet Package Manger Console:

    Install-Package MySql.Data.Entity installs version 6.9.8 by default. Your connector must match the actual version of the NuGet Package. You can download an updated version of the connector from: https://www.mysql.com/products/connector/

    Here select the "Ado.net driver for MySQL", and download the corresponding version (in this case 6.9.8). Reopen Visual Studio and now the wizard does not crash. No reboot required.

    0 讨论(0)
  • 2021-02-11 23:39

    I had this problem today, following the tips here that it is a "version mismatch" is completely correct!

    My important "discovery" is that they have renamed the package you need for EF6! As many people here has discovered (for example "Nofi"), downgrading to match versions fixes the problem. However, instead of downgrading the new versions, swap out the Mysql.Data.Entity package for the newer MySql.Data.EntityFramework! :)

    short: use MySql.Data.EntityFramework, NOT Mysql.Data.Entity

    0 讨论(0)
  • 2021-02-11 23:40

    Out of sheer luck and chance, I happened upon the same error. I am using VS 2015 with Entity Framework 6 as well. The error also happened as I was attempting to create the model from the database using EF reverse engineering existing connection.

    The problem is that even though the data connection exists, and you can refresh it, somehow the connection is broken. Go to the Server Explorer panel on the left, then under Data Connections find your existing connection, and instead of checking it using refresh, right click it and choose Modify Connection.

    From here try testing the connection and pressing OK. You should get an error (for me it said 'Unable to connect to any of the specified MySQL hosts.')

    0 讨论(0)
提交回复
热议问题