How do I install R
and RMYSQL
on RedHat Linux 8
?
Cannot get the epel
working. Trying to install R
gives dependency errors.
Followed the instructions here: https://linuxconfig.org/install-r-on-linux-redhat-8 (Assuming that you have already installed the MySQL)
Untar the downloaded R :
sudo su
tar -xzvf R-3.5.2.tar.gz
chown -R root:root R-3.5.2/
Now install the following using yum:
yum install java
yum install xz xz-devel
yum group install "Development tools"
yum install readline-devel
yum install xz xz-devel
yum install pcre pcre-devel
yum install libcurl-devel
yum install texlive
yum install *gfortran*
yum install zlib*
yum install bzip2-*
Now configure:
./configure -with-x=no
Make install :
make install
Now to launch R from anywhere:
./configure --prefix=/where/you/want/R/to/go
(sudo ./configure --prefix=/home/ec2-user/R-3.6.0/bin)
That should install the R.
you can move R: cp -r R-3.6.0 /usr/local/R
After this you can install DBI:
Install DBI
:
R CMD INSTALL DBI_1.0.0.tar.gz
Create the mariadb repo:
vi /etc/yum.repos.d/MariaDB.repo
Add the following in the repo file:
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.1/centos6-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
Install mariadb
yum install mariadb-devel
Get RMySQL from here: https://cran.r-project.org/web/packages/RMySQL/index.html
Install RMySQL:
R CMD INSTALL RMySQL_0.10.17.tar.gz
Test the installation:
R
library(RMySQL)
db <- dbConnect(MySQL(), user="userName", password="passWord", dbname="mysql", host="127.0.0.1")