Closing active connections using RMySQL

前端 未结 6 861
时光说笑
时光说笑 2020-12-28 18:49

As per my question earlier today, I suspect I have an issue with unclosed connections that is blocking data from being injected into my MySQL database. Data is being allowed

6条回答
  •  忘掉有多难
    2020-12-28 19:00

    Close all active connections:

    dbDisconnectAll <- function(){
      ile <- length(dbListConnections(MySQL())  )
      lapply( dbListConnections(MySQL()), function(x) dbDisconnect(x) )
      cat(sprintf("%s connection(s) closed.\n", ile))
    }
    

    executing: dbDisconnectAll()

提交回复
热议问题