Installing RStudio Professional Drivers

Use the following steps to install RStudio Professional Drivers on the same server where RStudio Server Pro and/or RStudio Connect is installed.

RStudio Professional Drivers 1.6 Preview release

Click here for the preview release of RStudio Professional Drivers 1.6.

Install dependencies

Install an OBDC driver manager using your system package manager:

$ sudo yum install unixODBC unixODBC-devel wget
$ sudo apt-get install unixodbc unixodbc-devel wget
$ sudo zypper install unixODBC unixODBC-devel wget
Additional steps for using the Oracle database driver

If you are working with the Oracle database, you will also need to:

  • Install the Oracle Instant Client

  • Link the Oracle library directory to the RStudio Pro Drivers library directory by running the following command:

    ln -s /usr/lib/oracle/12.1/client64/lib/* /opt/rstudio-drivers/oracle/lib/
    

For more information on connecting to Oracle Databases look at this support article.

Additional steps for using the Hive or Impala database drivers

If you are working with the Hive or Impala database drivers with authentication, you will also need to install the following system dependencies:

$ sudo yum install cyrus-sasl cyrus-sasl-devel cyrus-sasl-gssapi cyrus-sasl-plain
$ sudo apt-get install libaio1 libsasl2-2 libsasl2-dev
$ sudo zypper install cyrus-sasl cyrus-sasl-devel cyrus-sasl-gssapi cyrus-sasl-plain

Download and install

Download the RStudio Professional Drivers installation script:

Terminal

$ curl -O https://drivers.rstudio.org/7C152C12/odbc-install.sh

Create the directory where the drivers will be installed to:

Terminal

$ sudo mkdir -p /opt/rstudio-drivers

Move the installation script to the newly created directory:

Terminal

$ sudo mv odbc-install.sh /opt/rstudio-drivers

Navigate to the directory where the drivers will be installed to:

Terminal

$ cd /opt/rstudio-drivers

Install the drivers by running the following command:

Terminal

$ sudo bash ./odbc-install.sh

Info

You can replace /opt/rstudio-drivers with an alternate installation location in each of the above steps if desired.

Configure driver locations

Verify that your odbcinst.ini file was updated with the correct driver locations. Use odbcinst -j to locate this file.

Testing database connectivity

You should test your database connections from the command line before creating new connections in RStudio. You can test connections by running isql, a command line tool for interactive SQL. Note that isql requires you to create a data source name first.

ODBC Data Source Names (DSNs) are defined in the /etc/odbc.ini configuration file.

To create a new DSN, edit the file /etc/odbc.ini and add a new entry with the following contents:

File: /etc/odbc.ini

[test]
Driver = SQLServer
Server = my.server.name
Database = dbname
Port = 1433

The Driver setting in the DSN should refer to the corresponding driver name or path listed in /etc/odbcinst.ini.

To test this connection, run the following command:

Terminal

$ isql test -v