asp.net连接mysql数据库时,得到以下错误信息
MySql.Data.MySqlClient.MySqlException (0×80004005): error connecting: Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached.
得到这个错误,有2个原因:
1. 打开太多的mysql连接,没有及时关闭
2. 可能是因为启用了Pool的功能,请编辑连接字符串,添加 Pooling=False;
如Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;Pooling=False;