.NET 3.0 c#mysql连接器不能在本地计算机上运行

时间:2014-06-13 06:17:33

标签: c# mysql mysql-connector .net-3.0

在本地服务器macheine上运行应用程序时遇到问题。 在服务器上我安装了.NET 3.0,我在外部PC上开发,也有.NET 3.0

主要问题是MySQL连接打开,因为服务器(本地)mysql在连接打开时获取异常,但在我的外部(dev pc)它工作正常,我使用不同的连接登录并通过建立我的conn,bouth conn信息工作,因为我在bouth机器上使用php脚本检查,我的MySQL连接器.dll版本是6.5.4 v2,在外部机器应用程序上运行良好,但在内部(服务器)conn.Open();我得到例外:

异常消息:

MySql.Data.MySqlClient.MySqlException: Unable to connect to any of the specified MySQL hosts. ---> System.PlatformNotSupportedException: This operation is only supported on Windows 2000 SP3 or later operating systems.
   at System.Security.Principal.SecurityIdentifier..ctor(WellKnownSidType sidType, SecurityIdentifier domainSid)
   at System.Diagnostics.SharedUtils.EnterMutexWithoutGlobal(String mutexName, Mutex& mutex)
   at System.Diagnostics.SharedPerformanceCounter.GetCounter(String counterName, String instanceName, Boolean enableReuse, PerformanceCounterInstanceLifetime lifetime)
   at System.Diagnostics.SharedPerformanceCounter..ctor(String catName, String counterName, String instanceName, PerformanceCounterInstanceLifetime lifetime)
   at System.Diagnostics.PerformanceCounter.Initialize()
   at System.Diagnostics.PerformanceCounter.set_RawValue(Int64 value)
   at System.Net.NetworkingPerfCounters.Initialize()
   at System.Net.Configuration.SettingsSectionInternal..ctor(SettingsSection section)
   at System.Net.Configuration.SettingsSectionInternal.get_Section()
   at System.Net.Sockets.Socket.InitializeSockets()
   at System.Net.Dns.InternalGetHostByName(String hostName, Boolean includeIPv6)
   at System.Net.Dns.GetHostEntry(String hostNameOrAddress)
   at MySql.Data.Common.StreamCreator.GetDnsHostEntry(String hostname)
   at MySql.Data.Common.StreamCreator.GetHostEntry(String hostname)
   at MySql.Data.Common.StreamCreator.GetStreamFromHost(String pipeName, String hostName, UInt32 timeout)
   at MySql.Data.Common.StreamCreator.GetStream(UInt32 timeout)
   at MySql.Data.MySqlClient.NativeDriver.Open()
   --- End of inner exception stack trace ---
   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.GetPooledConnection()
   at MySql.Data.MySqlClient.MySqlPool.TryToGetDriver()
   at MySql.Data.MySqlClient.MySqlPool.GetConnection()
   at MySql.Data.MySqlClient.MySqlConnection.Open()
   at app.Form1.getLinks() in C:\Users\NAME\Desktop\app\app\Form1.cs:line 80

第80行: conn.Open();

抱歉忘了提到该应用程序之前有效,但必须在sql中进行更改。 DEV PC是Win7 64位,服务器是Microsoft Windows Server 2003 32位

0 个答案:

没有答案