I use RMariaDB::dbConnect()
to establish a connection to my MySQL database in R.
It works well, but during a long for
-loop where I insert values into the database with each iteration (using dbSendStatement()
), it happens every so often that I get the error:
Error: Lost connection to server during query [2013]
Is there any way to avoid it?
Are there any (dis-)advantages when I simply include a RMariaDB::dbConnect()
in the beginning of every single iteration?