I’m currently trying to write an application in Shiny that talks to a MySQL database. While developing I got the following error message after I has started the server a few times:
cannot allocate a new connection — maximum of 16 connections already > opened)
It turns out that the following line was opening connections and keeping them open:
mydb = dbConnect(MySQL(), user=’xxx’, password=’xxx’, dbname=’xxx’, host=’xxx’)
The solution was to loop through any connections and delete them:
cons<-dbListConnections(MySQL()) for(con in cons) dbDisconnect(con)
2 Comments
Vert · July 3, 2015 at 4:37 pm
That rescued my life!! Thanks very much!!!
lyx · September 12, 2017 at 9:00 am
I have find this problem for half a day,That rescued my life!! Thanks very much!!!