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

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