开发者

blogengine and mysql .net connector - fail to connect to db

开发者 https://www.devze.com 2022-12-14 15:49 出处:网络
ive got a problem when trying to connect to a mysql db for blogengine (1.5.0) using mysql .net connector.

ive got a problem when trying to connect to a mysql db for blogengine (1.5.0) using mysql .net connector.

im getting "Unable to connect to any of the specified MySQL hosts" error.

[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

what ive done so far:

1)tried to connect to my shared hosting mysql account

2)tried connect to my localhost server

3)tried changing .net connector from versoin 5.1.7 until 6.0.5

4)tried restarting IIS

and im still getting the error. i could connect to both server (shared n local) using mysql administrator n query browser. so theres no way its a firewall issue plus i already enable port 3306.

anyone experienced something like this before ? thanks.


i guess i found the problem. its got to do with my winsock. it was corrupted.

so all i did was netsh winsock reset . restart the pc, and i can connect to the db.

0

精彩评论

暂无评论...
验证码 换一张
取 消