导致超时的致命错误 -mysql [英] Fatal error causing timeout -mysql

查看:47
本文介绍了导致超时的致命错误 -mysql的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

MySql.Data.MySqlClient.MySqlException:命令期间遇到致命错误执行.--->MySql.Data.MySqlClient.MySqlException:超时已过.超时时间在完成之前经过操作或服务器不在回应.在MySql.Data.MySqlClient.MySqlDataReader.NextResult()在MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior行为)---内部异常结束堆栈跟踪

MySql.Data.MySqlClient.MySqlException: Fatal error encountered during command execution. ---> MySql.Data.MySqlClient.MySqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. at MySql.Data.MySqlClient.MySqlDataReader.NextResult() at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior) --- End of inner exception stack trace

这个错误是什么意思?我在连接字符串中有最大连接池 =200?我的应用程序是 .net 连接 mysql 数据库中的网络应用程序.

What does this error mean? I have max connection pool =200 in the connection string? my app is web app in .net connecting mysql db.

推荐答案

连接池不是这个问题的答案.连接池允许与服务器建立多个连接,然后再循环使用以避免重新建立连接.建立和重新建立连接的时间和计算资源可能非常昂贵.

Connection pooling isn't the answer to this problem. Connection pooling allows multiple connections to be made to the server and then recycled to avoid having to reestablish the connection. Establishing and reestablishing connections can be very expensive in time and computing resources.

您正在寻找的是增加命令超时.这可以通过以下两种方式之一完成.通过在连接字符串中指定 默认命令超时 或通过为 CommandTimeout 属性MySqlCommand.

What you're looking for is to increase the command timeout. This can be done one of two ways. Either in the connection string by specifying default command timeout or by assigning a value to the CommandTimeout property on the MySqlCommand.

这篇关于导致超时的致命错误 -mysql的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆