Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RMySQL or RMariaDB to connect to a MySQL 8 DB?

Perhaps it's a silly question, but at least for me is not that obvious. Perhaps for the naming.

I'm trying to figure out what is the correct package I'm need to use to connect my R code to a MySQL database.

I've read in the RMySQL package that:

NOTE: this package is being phased out in favor of the new RMariaDB package.

So in other words, from now on do I need to use RMariaDB package even if I'm connecting to MySQL or MySQL support is going to be dropped at some point since the databases are diverging a little bit on each version.

I specially ask in the context of MySQL 8.

Thanks!

like image 241
lpuerto Avatar asked Dec 14 '25 15:12

lpuerto


1 Answers

Yes, you should use RMariaDB instead of RMySQL.

Both RMariaDB and RMySQL are using the same database driver, the MariaDB Connector/C client library for client/server communication:

  • MariaDB Connector/C supports all MySQL and MariaDB specific authentication methods, so connecting to a MySQL 8.0 database server shouldn't be a problem.

  • Beside the X-Protocol, which isn't used in R, MariaDB Connector/C also supports all MySQL specific api features.

  • RMariaDB supports text and binary protocol for client/server communication. Differences between MySQL and MariaDB binary protocol are handled in MariaDB Connector/C, text protocol is still the same.

  • RMariaDB will be a replacement for RMySQL, so in near future you will not get bug or security fixes for RMySQL anymore.

like image 68
Georg Richter Avatar answered Dec 17 '25 10:12

Georg Richter



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!