简体   繁体   English

导致超时的致命错误 -mysql

[英]Fatal error causing timeout -mysql

MySql.Data.MySqlClient.MySqlException: Fatal error encountered during command execution. MySql.Data.MySqlClient.MySqlException:命令执行过程中遇到致命错误。 ---> MySql.Data.MySqlClient.MySqlException: Timeout expired. ---> MySql.Data.MySqlClient.MySqlException:超时。 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在 MySql.Data.MySqlClient.MySqlDataReader.NextResult() 在 MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior 行为) --- 内部异常堆栈跟踪结束

What does this error mean?这个错误是什么意思? I have max connection pool =200 in the connection string?我在连接字符串中有最大连接池 = 200? my app is web app in .net connecting mysql db.我的应用程序是 .net 中的 web 应用程序,连接 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.建立和重新建立连接在时间和计算资源方面可能非常昂贵。

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 .通过指定默认命令超时或通过为MySqlCommand上的CommandTimeout属性分配一个值,在连接字符串中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM