MySql& ASP.Net数据库超时问题
我正在使用 MochaHost 托管一个网站,但 MySQL 服务器的响应时间出现问题。
我收到很多错误 [HY000] [MySQL][ODBC 5.1 Driver]Can't connect to MySQL server on 'XX.XX.XX.XX' (10060)。
MochaHost 支持似乎对他们的服务缺乏任何了解,所以我试图自己找出解决方案。
为了允许较慢的响应时间,我在打开连接之前在 odbcConnection 对象上设置了 ConnectionTimeout。
objConn.ConnectionTimeout = 60
objConn.Open()
这似乎有所帮助,因为无法连接异常并不经常发生,但我现在收到以下消息:
System.Web.HttpException(0x80004005):请求超时。
所以看来我只是“重新定位”了这个问题。 MySql 或 webconfig 文件中是否有可以解决我的问题的设置?
该网站在 Windows 共享托管环境上运行
I'm hosting a site with MochaHost and I'm having problems with response time from the MySQL server.
I get a lot of ERROR [HY000] [MySQL][ODBC 5.1 Driver]Can't connect to MySQL server on 'XX.XX.XX.XX' (10060).
MochaHost support seems to lack any knowledge of all about their services, so I'm trying to figure out a solution myself.
In order to allow a slower response time I've set the ConnectionTimeout on the odbcConnection object before opening the connection.
objConn.ConnectionTimeout = 60
objConn.Open()
This seems to help as the can't connect exception does not occur that often, but I am now getting this:
System.Web.HttpException (0x80004005): Request timed out.
So it seems that I've just "relocated" the problem. Is there a setting in MySql or perhaps in the webconfig file which could solve my issue?
The site is running on a Windows shared hosting environment
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论