【求助】连接MySQL报错too many connections, show processlist太多(8000多条)sleep状态

jimyokl · · 3263 次点击
### 需要关闭一下链接吧 > 去掉一些defer 运行结束就关闭
#1
更多评论
谢谢 <a href="/user/smallforest" title="@smallforest">@smallforest</a> 我把3个stmt合为一个,在循环外 defer stmt.Close()
#2
改了以后还是报错: 2017-05-16 16:37:52 &lt;LL_ERROR&gt; stmt_del Exec err:Error 1040: Too many connections. 2017-05-16 16:37:52 &lt;LL_ERROR&gt; stmt_insert Exec err:Error 1040: Too many connections. 2017-05-16 16:37:52 &lt;LL_ERROR&gt; stmt_update Exec err:Error 1040: Too many connections. 2017-05-16 16:37:52 &lt;LL_ERROR&gt; Query err:Error 1040: Too many connections.
#3