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

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 Replies to “cannot allocate a new connection — maximum of 16 connections already > opened)”

Leave a Reply to lyx Cancel reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.