2013-06-29 122 views
-3

我们有一个部落MySQL数据库,用于跟踪游戏中的玩家统计数据。我们的MySQL负责人目前不在,我们正在收到以下错误无法连接到MySQL datebase

[18:17:18 23] Error in Tablebuilder: 
[18:17:18 23] Message: Unable to connect to any of the specified MySQL hosts. 
[18:17:18 23] Native: -2147467259 
[18:17:18 24] Source: MySql.Data 
[18:17:18 24] StackTrace: at MySql.Data.MySqlClient.NativeDriver.Open() 
at MySql.Data.MySqlClient.Driver.Open() 
at MySql.Data.MySqlClient.Driver.Create(MySqlConnecti onStringBuilder settings) 
at MySql.Data.MySqlClient.MySqlPool.GetPooledConnecti on() 
at MySql.Data.MySqlClient.MySqlPool.TryToGetDriver() 
at MySql.Data.MySqlClient.MySqlPool.GetConnection() 
at MySql.Data.MySqlClient.MySqlConnection.Open() 
at PRoConEvents.CChatGUIDStatsLoggerBF3.tablebuilder() 
[18:17:18 24] InnerException: System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 50.63.244.184:3306 
at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult) 
at MySql.Data.Common.StreamCreator.CreateSocketStream (IPAddress ip, Boolean unix) 
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() 
[18:17:18 24] Error: System.NullReferenceException: Object reference not set to an instance of an object. 
at PRoConEvents.CChatGUIDStatsLoggerBF3.tablebuilder() 

任何想法可能是什么问题?

+8

您的应用程序无法连接到数据库。 –

+0

你确定IP地址或域名是正确的吗? – jAC

+1

如果你周围没有人知道他们对MySQL或你的代码库的认识,我不确定我们能帮你。我的猜测是你的数据库服务器关闭了。 – millimoose

回答

0

你有两个例外,他们的测试,但是意思很明确:

"Unable to connect to any of the specified MySQL hosts."

"A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond"

因此,在短期:你的网络服务器无法连接到你的数据库服务器。您的数据库服务器(MySQL服务器进程mysqld.exe或服务器本身,如其操作系统,硬件,任何东西)可能会停止。或者防火墙被重置为阻止MySQL端口3306上的连接。它可能是任何东西

我假设你有一个标准的网络主机 - ping他们,并问他们为什么你的数据库服务器不可操作。

......但是在您让自己难堪之前,请确保您的应用程序连接到正确的服务器(即生产数据库,而不是开发数据库或临时数据库)。看看你的连接字符串。

1

您应该先阅读错误消息。它们看起来像胡言乱语,但当你仔细阅读时,往往有一部分会告诉你发生了什么。

[18时17分18秒24]的InnerException:System.Net.Sockets.SocketException:
连接尝试失败,因为连接的方没有正确一段时间后响应或已建立的连接失败,因为连接主机没有回应50.63.244.184:3306

现在你应该:

  1. 从数据库服务器执行telnet localhost 3306,如果失败,它与数据库服务器的问题
  2. 执行telnet 50.63.244.184 3306从应用程序服务器,如果它失败,这是网络的问题
+0

SQL查询: EXECUTE telnet localhost3306 MySQL说:文档 #1064 - 您的SQL语法错误;检查对应于你的MySQL服务器版本的手册,在第一行使用'localhost 3306'附近的正确语法 –

+0

@RickyAdams:telnet是一个linux命令,而不是MySQL命令 –