Home  >  Article  >  Database  >  mysql ExecuteReader问题_MySQL

mysql ExecuteReader问题_MySQL

WBOY
WBOYOriginal
2016-06-01 13:51:471083browse

今天遇到一棘手问题,在调用ExecuteReader时,出现如下异常信息:

The timeout period elapsed prior to obtaining a connection from the pool ...通过调用show processlist查看链接数,原来挂了几百个链接,没有及时释放。

代码在调用Reader之后,系统没有关闭Connection,结果导致Connection不够用。

ps:

命令: show processlist;
如果是root帐号,你能看到所有用户的当前连接。如果是其它普通帐号,只能看到自己占用的连接。
show processlist;只列出前100条,如果想全列出请使用show full processlist;

set global wait_timeout=100

设置连接等待时间为100毫秒。
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn