Install-Package Oracle.ManagedDataAccess -Version 12.2.20230118 版本可以安装到19.18
Install-Package MySql.Data -Version 8.0.32.1
config文件新增内容
<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=8.0.32.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
<remove invariant="Oracle.ManagedDataAccess.Client" />
<add name="ODP.NET, Managed Driver" invariant="Oracle.ManagedDataAccess.Client" description="Oracle Data Provider for .NET, Managed Driver" type="Oracle.ManagedDataAccess.Client.OracleClientFactory, Oracle.ManagedDataAccess, Version=4.122.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />
</DbProviderFactories>
</system.data>
mysql驱动测试最小代码
FluentData.IDbContext jywms = new FluentData.DbContext().ConnectionString(@"host=10.8.1.140;database=nwms;uid = ***; pwd =***;charset=gb2312", new FluentData.MySqlProvider());
var cc = jywms.Sql("select now()").QuerySingle<DateTime>();
Console.WriteLine("数据库时间 "+cc.ToString());
Console.ReadKey();
其他库
Install-Package FluentData
Install-Package Masuit.Tools.Net
标签:Console,驱动程序,Package,FluentData,Install,mysql,oracle From: https://www.cnblogs.com/hlm750908/p/18369993