2009-12-16 117 views
0

我嘗試使用mysql .net連接器連接到mysql數據庫的blogengine(1.5.0)時出現問題。blogengine和mysql .net連接器 - 無法連接到db

即時通訊「無法連接到任何指定的MySQL主機」錯誤。

[SocketException (0x273d): The attempted operation is not supported for the type of object referenced] System.Net.Sockets.Socket.get_ConnectEx() +305 System.Net.Sockets.Socket.BeginConnectEx(EndPoint remoteEP, Boolean flowContext, AsyncCallback callback, Object state) +479 System.Net.Sockets.Socket.BeginConnect(EndPoint remoteEP, AsyncCallback callback, Object state) +125 MySql.Data.Common.StreamCreator.CreateSocketStream(IPAddress ip, Boolean unix) +187 MySql.Data.Common.StreamCreator.GetStream(UInt32 timeout) +495 MySql.Data.MySqlClient.NativeDriver.Open() +234

[MySqlException (0x80004005): Unable to connect to any of the specified MySQL hosts.] MySql.Data.MySqlClient.NativeDriver.Open() +299 MySql.Data.MySqlClient.Driver.Create(MySqlConnectionStringBuilder settings) +48 MySql.Data.MySqlClient.MySqlPool.CreateNewPooledConnection() +11 MySql.Data.MySqlClient.MySqlPool.GetPooledConnection() +190 MySql.Data.MySqlClient.MySqlPool.TryToGetDriver() +129 MySql.Data.MySqlClient.MySqlPool.GetConnection() +106 MySql.Data.MySqlClient.MySqlConnection.Open() +293 BlogEngine.Core.Providers.DbBlogProvider.LoadSettings() +201 BlogEngine.Core.BlogSettings.Load() +63 BlogEngine.Core.BlogSettings..ctor() +25 BlogEngine.Core.BlogSettings.get_Instance() +29 BlogEngine.Core.Web.HttpModules.ReferrerModule..cctor() +71

[TypeInitializationException: The type initializer for 'BlogEngine.Core.Web.HttpModules.ReferrerModule' threw an exception.]

[TargetInvocationException: Exception has been thrown by the target of an invocation.] System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor, Boolean& bNeedSecurityCheck) +0 System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean fillCache) +86 System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean fillCache) +230 System.Activator.CreateInstance(Type type, Boolean nonPublic) +67 System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +1051 System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) +111 System.Web.Configuration.Common.ModulesEntry.Create() +39 System.Web.Configuration.HttpModulesSection.CreateModules() +164 System.Web.HttpApplication.InitModules() +28 System.Web.HttpApplication.InitInternal(HttpContext context, HttpApplicationState state, MethodInfo[] handlers) +729 System.Web.HttpApplicationFactory.GetNormalApplicationInstance(HttpContext context) +298 System.Web.HttpApplicationFactory.GetApplicationInstance(HttpContext context) +107 System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +289

什麼香港專業教育學院迄今所做的:

1)試圖連接到我的共享託管MySQL賬戶

2)試圖連接到我的本地服務器

3)試圖改變.net連接器從版本5.1.7直到6.0.5

4)嘗試重新啓動IIS

即時通訊仍然收到錯誤。我可以使用mysql管理員n查詢瀏覽器連接到服務器(共享本地)。所以沒有辦法防火牆的問題,加上我已經啓用端口3306.

任何人都經歷過這樣的事情嗎?謝謝。

回答

0

我想我發現了這個問題。它與我的winsock有關。它被損壞了。

所以我所做的只是netsh winsock重置。重新啓動電腦,我可以連接到數據庫。