Coldfusion 9 MySQL 通信链路故障

发布于 2024-10-09 01:45:18 字数 687 浏览 0 评论 0原文

我刚刚安装了 Coldfusion 9,现在一切工作正常,并且它通过 Coldfusion Administrator 作为数据源连接到我的 MySQL 数据库,但我很少出现此错误,可能每天 5 - 10 次。我不知道如何重新创建它,如果您获取它并刷新页面,它就会消失。

Error Executing Database Query. Communications link failure Last packet sent to the server was 0 ms ago

该错误被 Coldfusion 捕获,因为它显示一条用户友好的消息并通过电子邮件将问题发送给我。

几乎所有时间页面加载并工作正常,这个问题只在从 CFMX7 到 CF9 后发生,两者都使用 MySQL。

我使用的MySQL版本是“5.0.77”,

我尝试过使用localhost和127.0.0.1作为数据源中的主机,这没有什么区别。

有谁知道这是什么以及如何解决它?我看过一些类似的 Java 帖子,但我不知道如何将修复转换为 Coldfusion?无论如何,这可能是 MySQL 或 Apache 的问题吗?

编辑:我在昨天(11 日)上午 11 点未选中保持连接,此后就没有出现错误。通常我每天会得到 3 - 10 个,所以这看起来很有希望。我会等到明天再确认它已修复。我在 5.0.77 上使用 MySQL 4/5 驱动程序

I've just installed Coldfusion 9, and everything is now working fine and it's connected to my MySQL databse via the Coldfusion Administrator as a datasrouce, but I get this error occuring infrequently, maybe 5 - 10 times a day. I don't know how to recreate it, and if you get it and refresh the page it goes away.

Error Executing Database Query. Communications link failure Last packet sent to the server was 0 ms ago

The error is being caught by coldfusion as it's displaying a user friendly message and emailing me the problem.

Almost all of the time the pages load and work fine, and this problem has only happened since going from CFMX7 to CF9, both using MySQL.

The MySQL version I am using is "5.0.77"

I've tried localhost and 127.0.0.1 as the host in the datasource, it makes no difference.

Does anyone have any idea what this is and how to fix it? I've seen some similar posts for Java but I don't see how to translate the fix across into Coldfusion? And could it be a MySQL or Apache problem anyway?

EDIT: I UNCHECKED maintain connections at 11am yesterday (11th), and not had the error since. Usually I was getting 3 - 10 a day, so this seems hopeful. I'll wait until tomorrow before confirming it is fixed. I'm using the MySQL 4/5 driver on 5.0.77

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

伤感在游骋 2024-10-16 01:45:18

Adobe 论坛上讨论了此问题。看起来合适的解决方法是在 ColdFusion 数据源定义中启用验证查询,例如“Select 1”(不带引号)。 ColdFusion 将通过运行该简单查询来测试每个连接,然后再让页面请求使用该数据库连接。这将保证每个数据库连接在应用程序中使用之前都处于良好状态。

更多详细信息请访问:
http://forums.adobe.com/message/3396302#3396302

This issue was discussed on the Adobe forums. It appears that a suitable workaround is to enable a Validation Query in the ColdFusion datasource definition such as "Select 1" (without quotes). ColdFusion will test every connection by running that simple query before letting the page request use that db connection. This will guarantee that every db connection is good before use in the application.

More details available at:
http://forums.adobe.com/message/3396302#3396302

誰認得朕 2024-10-16 01:45:18

除非您将 Apache Tomcat 作为 ColdFusion 的 servlet 引擎,否则 Apache 不会成为您的问题。 Apache HTTPD 不会导致这种情况。

这看起来确实是 JDBC 连接器和 MySQL 之间的一个错误。你能告诉我你用的mysql是什么版本吗?

Apache wouldn't be your problem unless you are talking about Apache Tomcat as your servlet engine for ColdFusion. Apache HTTPD wouldn't be able to cause that.

It does seem like this is a bug in between the JDBC Connector and MySQL. Could you tell me what version of mysql you are on?

国粹 2024-10-16 01:45:18

根据 Steven Erat 给出的解决方案,将验证查询添加到数据源为我解决了同样的问题。

我只是补充一点,您需要确保添加“SELECT 1”查询并选中查询上方的“启用连接验证”复选框。

我错过了一些数据源上的复选框,问题后来又出现了......(咧嘴笑)

Adding the Validation Query to the datasource fixed the same problem for me as per the solution given by Steven Erat.

I'd simply add that you need to make sure you add the "SELECT 1" query AND check the "Enable connection validation" checkbox just above the query.

I missed checking the box on a few datasources and the problem snuck back in later... (grin)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文