gpt4 book ai didi

mysql - 错误 0x80131047 加载 MySQL 连接器 DLL

转载 作者:行者123 更新时间:2023-11-28 23:25:31 28 4
gpt4 key购买 nike

PowerShell 刚刚开源 (v6.0.0-alpha.10),我试图让它从 OS X 连接到 MySQL 实例。

Oracle 似乎暗示(如果我没看错的话)他们有一个.Net 核心连接器 here .我像这样运行安装:

Install-Package MySql.ConnectorNET.Entity -Destination /MySQL

输出看起来不错:

Name                       Version Source Summary                ----                       ------- ------ ------- MySql.ConnectorNET.Data    6.8.3.2 nugget ADO.Net driver for MySQL    MySql.ConnectorNET.Entity  6.8.3.2 nugget MySql Connector/NET for Entity Framework 6

When I try loading the assembly like this:

[System.Reflection.Assembly]::Load(/MySQL/MySql.ConnectorNET.Data.6.8.3.2/lib/net45/MySql.Data.dll)

我收到以下错误(请注意,我通过变量 $dll):

Exception calling "Load" with "1" argument(s): "Could not loadfile or assembly'/MySQL/MySql.ConnectorNET.Entity.6.8.3.2/lib/net40/MySql.Data.dll,Culture=neutral, PublicKeyToken=null'. The given assembly name orcodebase was invalid. (Exception from HRESULT: 0x80131047)" At/development/scripts/test.ps1:28 char:1+ [System.Reflection.Assembly]::Load("$dll")+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException    + FullyQualifiedErrorId : FileLoadException

Any ideas on a workaround / fix? I realize that PowerShell is still inalpha.

EDIT

I was able to install the MySQL provider using these two commands:

Register-PackageSource -Name nuget.org -ProviderName NuGet -Location https://www.nuget.org/api/v2/
Install-Package MySql.Data.EntityFrameworkCore -Destination /Volumes/Main/libraries/MySQL/ -AllowPrereleaseVersions

我尝试注册所有我能想到的程序集:

Microsoft.EntityFrameworkCore.1.0.1/lib/netstandard1.3/Microsoft.EntityFrameworkCore.dllMicrosoft.Extensions.Configuration.1.0.0/lib/netstandard1.1/Microsoft.Extensions.Configuration.dllMicrosoft.Extensions.Configuration.Json.1.0.0/lib/netstandard1.3/Microsoft.Extensions.Configuration.Json.dllMySql.Data.EntityFrameworkCore.7.0.5-IR21/lib/netstandard1.6/MySql.Data.EntityFrameworkCore.dllMySql.Data.7.0.5-IR21/lib/netstandard1.6/MySql.Data.dll 

但是,当试图创建一个新的 MySql 对象时,它仍然会爆炸这个:

New-Object : Cannot find type [MySql.Data.MySqlClient]: verify that the assembly containing this type is loaded.

最佳答案

这不是 .NET Core 库 - 此处的“Core”一词表示 EF6 和 Web 包之间共享的功能,并且早于 .NET Core 的引入。

在撰写本文时,Entity Framework Core 具有正在开发中的 MySql 库。

关于mysql - 错误 0x80131047 加载 MySQL 连接器 DLL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39560160/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com