当前位置:网站首页>Connection between mysql+c ef6
Connection between mysql+c ef6
2022-06-09 15:16:00 【Game programming】
It took three days , Stepped on countless pits , At last, half the success was achieved
Can now pass Code First Model generation database , however Model First The model will still flash back




<?xml version="1.0" encoding="utf-8"?><configuration> <configSections> <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" /> <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --> </configSections> <startup> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" /> </startup> <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <dependentAssembly> <assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" /> </dependentAssembly> <dependentAssembly> <assemblyIdentity name="MySql.Data" publicKeyToken="c5687fc88969c44d" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-6.8.8.0" newVersion="6.8.8.0" /> </dependentAssembly> </assemblyBinding> </runtime> <entityFramework> <providers> <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" /> </providers> <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework"> <parameters> <parameter value="mssqllocaldb" /> </parameters> </defaultConnectionFactory> </entityFramework> <system.data> <DbProviderFactories> <remove invariant="MySql.Data.MySqlClient" /> <add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.8.8.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" /> </DbProviderFactories> </system.data> <connectionStrings> <add name="connStr" connectionString="data source=127.0.0.1;user=root;password=root;database=sqltest;" providerName="MySql.Data.MySqlClient" /> <add name="Model1" connectionString="server=127.0.0.1;port=3306;user=root;password=root; database=Model1;sslmode=none;" providerName="MySql.Data.MySqlClient" /> </connectionStrings></configuration> ( Make complaints about it ,sql server It's my son , All the way down smoothly , what bug either , You don't need the next pile of plug-ins )
The following describes the pitfalls and solutions encountered :
(1) The first pit , To install plug-ins , And the version of the plug-in must correspond to , Otherwise, the database cannot be connected , The version I installed is as follows

(2) The second pit , Version match , Version mismatch will display “System.ArgumentException: Option not supported…”
The reason is the version problem , Refer to two articles to solve :
https://zhuanlan.zhihu.com/p/43190042
https://www.cnblogs.com/tthjHiroki/p/8269480.html
Roughly speaking :Oracle In the upgrade MySql.Data To 8.x After version , There is no direct use of the original MySql.Data.Entity Also upgrade to 8.x, But changed its name to MySql.Data.EntityFramework, however Nuget The configuration information in is not correct , So there will be bug, The solution is to reduce the version
My version , For reference only :
①Install-Package EntityFramework -Version 6.1.3
②Install - Package MySql.Data - Version 6.8.8
③Install - Package MySql.Data.Entity - Version 6.8.3
(3) Modify the default : Configure connection string ( Default sqlserver, It has to be changed to mysql Of )

(4)context Model prefix
DbConfigurationType(typeof(MySql.Data.Entity.MySqlEFConfiguration))] If you don't do this, you won't generate a model , It's also a pit , because sql server No such problem
(5)mysql: call SSPI Failure , See inner exception .
Solution :
Connection string add :
sslmode=none; (6) Tips “Authentication plugin ‘caching_sha2_password‘ cannot be loaded…”
Only need to my.ini In the document default_authentication_plugin Property set to mysql_native_password that will do
That is to say default_authentication_plugin = mysql_native_password
(7) Can't find my.ini file
I unpacked the installation , At this point, find the installation directory , Build your own my.ini service , And then restart mysql service
Reference resources :https://blog.csdn.net/qq_43045747/article/details/125043557
It is not easy to , Every step is a pit , It's still honest and practical sql server Well
author : The sword gives birth and the sword gives death
Game programming , A game development favorite ~
If the picture is not displayed for a long time , Please use Chrome Kernel browser .
边栏推荐
- ONES 冯斌:从工程师到CTO,与不确定性和信息不完备为伴|ONES Talk
- ^28JS是单线程的
- Hongmeng porting i.mx6ull (11) storage device driver (based on imx6ull)
- Hongmeng porting i.mx6ull (VI) kconfig_ GCC_ Mkefile
- JS implements JSON array merging and de duplication
- 4年经验来面试20K的测试岗,连基本功都不会,还不如去招应届生
- 134. 加油站
- Jupyter lab learning notes
- ^27定时器的相关问题
- Hongmeng porting i.mx6ull (x) system clock
猜你喜欢

Award winning research

如何优雅的自定义 ThreadPoolExecutor 线程池

使用 KubeKey 搭建 Kubernetes/KubeSphere 环境的“心路(累)历程“

CICC digital intelligence China II: five questions and five answers to database business market

Hardware foundation - analog circuit

详解Seaborn,看这一篇就够了

List used by icomponent of unity dots

mysql学习

高速缓冲存储器Cache地址映像与变换及相联目录表的设计

【二、虚拟主机和域名解析】
随机推荐
鸿蒙移植i.mx6ull(五) 移植概述
从版权到资产 NFT有多不安全?
Web3 的“中国特色”
期货网上开户安全吗?期货妙手机开户吗?
品牌与产品的二律背反
Is it safe to open an account in an external market or domestic futures?
mongoose连接多个数据库简单例子
insert into select/update
Taoist friends! What is the expiration policy of redis?
Hongmeng porting i.mx6ull (12) root file system
鸿蒙移植i.mx6ull(六) Kconfig_GCC_Mkefile
【论文】Cascade R-CNN: Delving into High Quality Object Detection
unity Dots的IComponent使用的列表踩的坑
请教股票怎么在手机上开户流程?股票开户流程网上开户安全吗?
Simple example of mongoose connecting multiple databases
JS实现复制内容到剪贴板的方法
AE脚本-网格参考线黄金分割线生成工具 GuidesUp! 2.2激活版
【论文】Cascade RPN: Delving into high-quality region proposal network with Adaptive Convolution
A Baidu programmer was sentenced to: dissatisfied with others taking over the project, showing his own role, deleting and modifying the database for many times, and committing the crime of destroying
cx_ oracle ORA-01036