环境:Windows 2008 R2& ASP.Net 4.0
来自here的连接器/网络6.6.4
注意:我选择了“.Net / Mono”平台并下载了与架构无关的版本。 Enable-32-bit-application-in-IIS不适合我。
我尝试通过以下连接字符串连接mySQL数据库。
Server=192.168.1.200;Port=3306;Database=gm_log;Uid=cf2;Pwd=123456;Charset=utf8;AllowUserVariables=True;Allow Zero Datetime=false;PersistSecurityInfo=false;Pooling=true;ConnectionLifeTime=0;Max Pool Size=100;Min Pool Size=1;
并且MySqlConnection.Open抛出一个OverflowException。 算术运算导致溢出
这是堆栈跟踪。
at MySql.Data.MySqlClient.Authentication.MySqlAuthenticationPlugin.HandleAuthChange(MySqlPacket packet)
at MySql.Data.MySqlClient.Authentication.MySqlAuthenticationPlugin.Authenticate(Boolean reset)
at MySql.Data.MySqlClient.NativeDriver.Open()
at MySql.Data.MySqlClient.Driver.Open()
at MySql.Data.MySqlClient.Driver.Create(MySqlConnectionStringBuilder settings)
at MySql.Data.MySqlClient.MySqlPool.CreateNewPooledConnection()
at MySql.Data.MySqlClient.MySqlPool..ctor(MySqlConnectionStringBuilder settings)
at MySql.Data.MySqlClient.MySqlPoolManager.GetPool(MySqlConnectionStringBuilder settings)
at MySql.Data.MySqlClient.MySqlConnection.Open()
其他人遇到同样的问题吗?
答案 0 :(得分:5)
答案 1 :(得分:3)
我不得不遇到同样的问题。但我使用Nuget来安装MySql.Data包。 如果您使用的是Nuget,则可以使用Library Package Manager控制台中的以下命令降级版本。
Install-Package MySql.Data -Version x.x.x.x
x.x.x.x是旧版本。在我的情况下,我尽可能地回去并使用5.1.7.0。您可以检查nuget站点以查看可用的版本,或者您可以使用以下命令再次使用控制台。
PM> Get-Package -ListAvailable -AllVersions -Filter MySql.Data
Id Version Description/Release Notes
-- ------- -------------------------
Ming.MySql.Data 6.5.4.0 ADO.Net driver for MySQL
MySql.Data 5.1.7.0 Connector/Net is a fully-managed ADO.NET driver for MySQL.
MySql.Data 6.2.5 Connector/Net is a fully-managed ADO.NET driver for MySQL.
MySql.Data 6.3.7 Connector/Net is a fully-managed ADO.NET driver for MySQL.
MySql.Data 6.4.4 Connector/Net is a fully-managed ADO.NET driver for MySQL.
MySql.Data 6.5.4 Connector/Net is a fully-managed ADO.NET driver for MySQL.
MySql.Data 6.6.4 Connector/Net is a fully-managed ADO.NET driver for MySQL.
MySQL.Data.Entities 6.4.4.0 Connector/Net is a fully-managed ADO.NET driver for MySQL. Entity Framework support package (Mysql.Data.Entities).
MySQL.Data.Entities 6.5.4.0 Connector/Net is a fully-managed ADO.NET driver for MySQL. Entity Framework support package (Mysql.Data.Entities).
编辑:经过更多实验,我确定我只需要回到6.4.4而不是5.1.7.0。到目前为止还存在其他问题。