简体   繁体   中英

Fatal error causing timeout -mysql

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

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.

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 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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