cannot allocate a new connection — maximum of 16 connections already > opened)

By | July 25, 2013

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)

Leave a Reply

Your email address will not be published. Required fields are marked *