Installing RStudio Professional Drivers

Linux

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

Upgrading from RStudio Professional Drivers 1.4.0

Starting with version 1.6.0, the RStudio Professional Drivers can be downloaded and installed using .rpm and .deb packages and your system package manager instead of the installer script that was used in version 1.4.0. In addition the new functionality provided in this release, this will also make future upgrades of the Pro Drivers much easier.

We recommend removing existing installations of version 1.4.0 of the Pro Drivers to avoid the accidental use of the wrong version of the drivers in your R and Python code. However, if desired, both versions of the drivers can coexist in the same system and be used without issues.

To uninstall version 1.4.0 of the Pro Drivers, you can remove the directory that they were installed to. Then follow the installation steps for version 1.6.0 as described below, and verify that the /etc/odbcinst.ini file is pointing to the new version of the drivers located at /opt/rstudio-drivers.

Install dependencies

Install an OBDC driver manager using your system package manager:

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

The current Oracle driver is not supported on RHEL 8

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/bin/lib/
    

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

Download and install

Download and install the RStudio Professional Drivers:

$ curl -O https://drivers.rstudio.org/7C152C12/installer/rstudio-drivers-1.6.0-1.el7.x86_64.rpm
$ sudo yum install rstudio-drivers-1.6.0-1.el7.x86_64.rpm
$ curl -O https://drivers.rstudio.org/7C152C12/installer/rstudio-drivers_1.6.0_amd64.deb
$ sudo gdebi rstudio-drivers_1.6.0_amd64.deb
$ curl -O https://drivers.rstudio.org/7C152C12/installer/rstudio-drivers-1.6.0-1.sles12.x86_64.rpm
$ sudo zypper --no-gpg-checks install rstudio-drivers-1.6.0-1.sles12.x86_64.rpm
$ curl -O https://drivers.rstudio.org/7C152C12/installer/rstudio-drivers-1.6.0-1.sles15.x86_64.rpm
$ sudo zypper --no-gpg-checks install rstudio-drivers-1.6.0-1.sles15.x86_64.rpm
Alternative download and installation method

In some cases, you might want to use an alternative installation method to install the RStudio Professional Drivers other than .rpm or .deb packages, for example, when:

  • Installing drivers to a location other than /opt/rstudio-drivers
  • Installing drivers as a non-root user
  • Installing a single driver or a subset of drivers

For this reason, we provide the drivers as a single compressed .tar file that can be manually extracted and moved to the desired location:

Download RStudio Professional Drivers as a single compressed .tar file

Refer to the detailed documentation for each driver for instructions on how to configure each driver.

Configure driver locations

The drivers will be installed to /opt/rstudio-drivers/. The ODBC driver names and locations are specified in the /etc/odbcinst.ini configuration file.

A sample of this file is included at /opt/rstudio-drivers/odbcinst.ini.sample that is preconfigured with the names and locations of the RStudio Professional Drivers.

You can use the following commands to backup your existing /etc/odbcinst.ini file and write the contents of the sample configuration file to /etc/odbcinst.ini on your system:

# Backup existing ODBC configuration file
$ sudo cp /etc/odbcinst.ini /etc/odbcinst.ini.bak

# Append sample ODBC configuration file into /etc/
$ cat /opt/rstudio-drivers/odbcinst.ini.sample | sudo tee /etc/odbcinst.ini
# Backup existing ODBC configuration file
$ sudo cp /etc/unixODBC/odbcinst.ini /etc/unixODBC/odbcinst.ini.bak

# Append sample ODBC configuration file into /etc/unixODBC/
$ cat /opt/rstudio-drivers/odbcinst.ini.sample | sudo tee /etc/unixODBC/odbcinst.ini

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

Troubleshooting

Refer to the support article on Troubleshooting RStudio Professional Drivers for additional information on troubleshooting the ODBC drivers and dependencies.

Uninstallation

Use the following commands to uninstall the RStudio Professional Drivers:

$ sudo yum remove rstudio-drivers
$ sudo apt-get remove rstudio-drivers
$ sudo zypper rm rstudio-drivers

Desktop

Use the following steps to install RStudio Professional Drivers using RStudio Desktop Pro.

MacOS

Install dependencies

Install the unixODBC driver manager. The easiest method is using Homebrew:

brew install unixodbc
Additional steps for using the Oracle database driver

The current Oracle driver is not supported on MacOS Mojave and requires MacOS Catalina

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

  • Install version 12.2.0.1.0 of the Oracle Instant Client. Either the Basic Package or the Basic Light Package is required. Once the zip file is downloaded, follow the installation instructions for Installing Instant Client 12.2 on MacOS.

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

Install the drivers

The drivers are installed using RStudio Desktop Pro:

  1. Open RStudio Desktop Pro
  2. Within the Connections Pane, click New Connection
  3. Select the data source from the list
  4. Specify where the driver will be installed (the default path is /Users/<user>/.rstudio-desktop/odbc/drivers) and click Next
  5. After installation, click Next
  6. The driver has now been installed. You can either click Cancel or enter connection details to test and/or establish a connection.

Installing the drivers this way automatically updates entries in the odbcinst.ini file used by unixODBC. To determine the path to the file that is used, run the following in the terminal:

Terminal

$ odbcinst -j

The DRIVERS... entry shows the location of the odbcinst.ini file.

Testing database connectivity

Database connectivity can be tested directly from within RStudio Desktop pro:

  1. Open RStudio Desktop Pro
  2. Within the Connections Pane, click New Connection
  3. Select the data source from the list
  4. Enter the requested information and click Test
  5. If prompted, enter the database password

If you prefer, you can also setup ODBC Data Source Names (DSNs) to test and make database connections. DSNs can be defined in ~/.odbc.ini. For example:

File: ~/.odbc.ini

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

You can then access the DSN directly from the New Connection dialogue or test from the terminal with the following:

Terminal

$ isql test

Uninstallation

The drivers are uninstalled using RStudio Desktop Pro:

  1. Open RStudio Desktop Pro
  2. Within the Connections Pane, click New Connection
  3. Select the data source from the list
  4. Click Uninstall...
  5. Click Yes when asked if you want to uninstall the driver

This will remove the driver files and delete the driver entry from odbcinst.ini.

Windows

Install dependencies

Install the Visual C++ Redistributables.

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

  • Unzip the contents of the downloaded folder and copy them to the \lib subfolder in the installation directory of the driver. If the default installation path is used, this directory is C:\Users\<user>\AppData\Local\RStudio-Desktop\odbc\drivers\oracle\bin\lib

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

Install the drivers

The drivers are installed using RStudio Desktop Pro:

  1. Open RStudio Desktop Pro
  2. Within the Connections Pane, click New Connection
  3. Select the data source from the list
  4. Specify where the driver will be installed (the default path is C:\Users\<user>\AppData\Local\RStudio-Desktop\odbc\drivers) and click Next
  5. Click Yes when asked if you want to allow this app to make changes to your device
  6. Click Yes when asked if you want to continue
  7. Click Ok
  8. After installation, click Next
  9. The driver has now been installed. You can either click Cancel or enter connection details to test and/or establish a connection.

Testing database connectivity

Database connectivity can be tested directly from within RStudio Desktop pro:

  1. Open RStudio Desktop Pro
  2. Within the Connections Pane, click New Connection
  3. Select the data source from the list
  4. Enter the requested information and click Test
  5. If prompted, enter the database password

If you prefer, you can also setup ODBC Data Source Names (DSNs) to test and make database connections. DSNs can be defined using the ODBC Data Source Administrator application. You can test DSN connectivity directly within ODBC Data Source Administrator.

Uninstallation

The drivers are uninstalled using RStudio Desktop Pro:

  1. Open RStudio Desktop Pro
  2. Within the Connections Pane, click New Connection
  3. Select the data source from the list
  4. Click Uninstall...
  5. Click Yes when asked if you want to uninstall the driver
  6. Click Yes when asked if you want to allow this app to make changes to your device
  7. Click Yes when asked if you want to continue
  8. Click Ok

This will remove the driver files and delete registry entries that reference the driver.

Linux

The drivers can be installed for a linux desktop environment by following the directions outlined above under Linux.