I tried to use RMySQL package but i get this error doing:
install.packages('RMySQL')
Warning in install.packages :
package ‘RMySQL’ is not available (for R version 2.14.2)
What can I do to use MySQL with R?
Thank you!
The simplest and recommended method is to download MySQL Installer for Windows from https://dev.mysql.com/downloads/installer/ and execute it. Select mysql-installer-web-community-8.0. 23. msi if you have good internet connection, otherwise choose mysql-installer-community-8.0.
Open the Command Prompt and navigate to the bin folder of your MySQL Server installation directory. Then connect to the server using the mysql -u root -p command. Enter the password and execute the SHOW DATABASES; command we have discussed above.
There is not a windows binary available for the package RMySQL
. This means you will have to install this package from source and build it yourself.
At the CRAN RMySql page you will notice there is no binary available, with a link to Pre-compiled binary packages for R-2.14.x for Windows
From this page:
Packages related to many database system must be linked to the exact
version of the database system the user has installed, hence it does
not make sense to provide binaries for packages
RMySQL, ROracle, ROracleUI,
although it is possible to install such packages from sources by
install.packages('packagename', type='source')
after reading the manual 'R Installation and Administration'.
So, read the manuals, in particular R Installation and Administration, install RTools, and then use:
install.packages('RMySQL', type='source')
After installing Rtools, from the RMySQL CRAN page grab the source from the Package source:
link to ensure that you have the latest version. Then read the information in the INSTALL
file that comes with the package (or find the same info at the Installation:
link on the aforementioned CRAN page).
The main problem that most people have is following outdated information on the internet that pertains to older versions of RMySQL rather than using the instructions that come with the package itself.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With