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)
That rescued my life!! Thanks very much!!!
I have find this problem for half a day,That rescued my life!! Thanks very much!!!