Can't close mysql connections in R

天涯浪子 提交于 2019-12-11 03:47:29

问题


Would appreciate any tips regarding how to close MySQL connections in R.

Used dbDisconnect(), but it kept throwing an error:

Error in (function (classes, fdef, mtable) : unable to find an inherited method for function 'dbDisconnect' for signature '"MySQLConnection"


回答1:


In order to disconnect you need to give dbDisconnect() the right connection. Make sure your connection does have a name in the first place. Always open a connection with

mydb <- dbConnect(..)

As soon as you don't need it anymore you can close it with

dbDisconnect(mydb)


来源:https://stackoverflow.com/questions/30363887/cant-close-mysql-connections-in-r

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!