這篇是在1月份發布在自己的博客上,現在搬運到我們的博客園來
.NetCore3.1 使用MySql.Data.EntityFrameworkCore8.0.18 連接MySql數據庫異常,需要替換MySql數據庫連接驅動
今天寫demo是用.net Core3.1 MySql,和以前一樣添加引用MySql.Data,MySql.Data.EntityFrameworkCore 。在做數據庫遷移報錯,錯誤信息如下:
Method 'get_Info' in type 'MySql.Data.EntityFrameworkCore.Infraestructure.MySQLOptionsExtension' from assembly 'MySql.Data.EntityFrameworkCore, Version=8.0.18.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' does not have an implementation.
解決方案:
1、卸載MySql.Data,MySql.Data.EntityFrameworkCore
2、添加Pomelo.EntityFrameworkCore.MySql