Install Pro Drivers on a Linux Server

These procedures are for IT Admins that need to install the Posit Professional Drivers on a Linux server where Workbench and/or Connect is installed.
Posit End User License Agreement

This page includes instructions for downloading Posit professional products. Download and/or use of these products is governed under the terms of the Posit End User License Agreement. By downloading you agree to the terms posted there.

Keep ODBC drivers current

We strongly recommend upgrading drivers to prevent security and administrative issues. Update drivers system-wide with at least the same frequency as other Posit products.

Install Posit Professional Drivers on the same server where the following were previously installed:

Requirements

These drivers require one of the following Posit Professional products installed:

  • RStudio Desktop Pro
  • Posit Workbench
  • Posit Connect
  • Shiny Server Pro

The Platform Support page provides additional information about the supported operating systems and browsers that the Posit software supports.

Additionally, Posit software supports the operating systems and browsers listed until:

  • the vendor no longer supports them or
  • R/Python no longer supports them

Installation

Posit End User License Agreement

This page includes instructions for downloading Posit professional products. Download and/or use of these products is governed under the terms of the Posit End User License Agreement. By downloading you agree to the terms posted there.

Step 1. Install dependencies

  • Install an ODBC driver manager using your system package manager:

    sudo yum install unixODBC unixODBC-devel

    Some binary-compatible distributions, such as Rocky Linux 9, may require the --enablerepo=devel flag to install the unixODBC-devel package.

    sudo apt-get install unixodbc unixodbc-dev
    sudo zypper install unixODBC unixODBC-devel

    If you are working with the Oracle database, you must:

    • Install a supported version of the Oracle Instant Client compatible with your platform/architecture.

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

      ln -s /usr/lib/oracle/<version>/client64/lib/* /opt/rstudio-drivers/oracle/bin/lib/

      The path to Oracle libraries may differ based on your platform and installation method. For example, on Linux systems it is commonly /usr/lib/oracle/<version>/client64/lib/, where <version> reflects your installed Oracle Instant Client version.

    For more information on connecting to Oracle Databases, see the Connecting to Oracle databases with Posit Professional Drivers support article.

    If you are using AWS RDS for MySQL, driver version 2024.03 removes the mysql_native_password plugin, which is the default authentication plugin used in AWS RDS for MySQL. This removal breaks authentication with AWS RDS for MySQL databases unless the follow change runs in advance of the ODBC driver upgrade.

    1. Connect to the destination MySQL database using your current MySQL drivers.

    2. Once connected, execute the follow statement to change the authentication plugin for your Master Username/Master Password from the AWS Console:

      ALTER USER 'ReplaceWithMasterUsername'@'%' IDENTIFIED WITH caching_sha2_password by 'ReplaceWithMasterPassword' REPLACE 'ReplaceWithMasterPassword';
    3. Run the same command for any other users that needs to connect to your AWS RDS for MySQL database, using their username and password in the command.

    4. Proceed with the driver upgrade.

    Future resets of the Master Password in the AWS console reverts to using mysql_native_password plugin, locking your user out of the database via the Posit Professional Drivers. Connect to the AWS RDS for MySQl database via alternate means to rerun the statement above.

Step 2. Download and install

Posit End User License Agreement

This page includes instructions for downloading Posit professional products. Download and/or use of these products is governed under the terms of the Posit End User License Agreement. By downloading you agree to the terms posted there.

  • Download and install the Posit Professional Drivers:
curl -O https://cdn.rstudio.com/drivers/7C152C12/installer/rstudio-drivers-2024.03.0-1.el.x86_64.rpm
sudo yum install ./rstudio-drivers-2024.03.0-1.el.x86_64.rpm
curl -O https://cdn.rstudio.com/drivers/7C152C12/installer/rstudio-drivers_2024.03.0_amd64.deb
sudo apt-get install ./rstudio-drivers_2024.03.0_amd64.deb
curl -O https://cdn.rstudio.com/drivers/7C152C12/installer/rstudio-drivers-2024.03.0-1.sles.x86_64.rpm
sudo zypper --no-gpg-checks install ./rstudio-drivers-2024.03.0-1.sles.x86_64.rpm

Alternative method

To use an alternative download and installation method to install the Posit Professional Drivers other than .rpm or .deb packages, for example:

  • 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:

Step 3. Configure driver locations

The drivers install to /opt/rstudio-drivers/. Specify The ODBC driver names and locations are in the /etc/odbcinst.ini configuration file.

View an example of this file at /opt/rstudio-drivers/odbcinst.ini.sample. The file is preconfigured with the names and locations of the Posit Professional Drivers.

  • Use the following commands to backup your existing /etc/odbcinst.ini file and write the contents of the example 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 -a /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 -a /etc/unixODBC/odbcinst.ini

Step 4. Testing database connectivity

Test your database connections from the command line before creating new connections in Posit.

How to test:

  • You can test connections by running isql (a command line tool for interactive SQL
  • The isql command requires you to create a data source name (DSN) first
  • Additionally, you could be required to specify a user and password argument for connection. See isql (1) - Linux Man Pages for additional information.

The /etc/odbc.ini configuration file defines the ODBC Data Source Names (DSNs).

To create a new DSN:

  • Edit the file /etc/odbc.ini
  • Add a new entry for your desired database type by copying over the example from /opt/rstudio-drivers/odbc.ini.sample
  • Ensure that the Driver setting in the DSN refers to the corresponding driver name or path listed in /etc/odbcinst.ini
  • Modify the entry with your desired connection parameters

For example, to add a SQL Server connection:

File: /etc/odbc.ini
[test]
Driver = SQLServer
Server = my.server.name
Database = dbname
Port = 1433

To test this connection, run the following command:

isql -v test

Upgrading

Installing the latest version of the Professional Drivers replaces the currently installed version.

Usage

How to utilize Posit’s Professional Drivers from R and Python.

Install the odbc package

Install the odbc package

Use the odbc R package to access your database with R:

  • From an R prompt, install the odbc package (installing odbc also installs DBI, the database interface for R):

    R Console
    install.packages("odbc")
    Note

    On Linux, the odbc R package requires the following system dependencies in Linux:

    • C++11
    • GCC 4.8 or later

    On older versions of RHEL, you can install GCC 4.8 with RedHat Developer Toolset:

    sudo yum install devtoolset-4-gcc-c++

Test connectivity

  • Test your connection in R with odbc::odbc().
    • If you are using RStudio (the IDE), you can use the New Connection dialog to help you write the connection string, for example:

      R Console
      con <- DBI::dbConnect(odbc::odbc(),
              Driver = "Driver Name",
              Database = "Database",
              UID = "User",
              PWD = "Password",
              Server = "Server",
              Port = 5432)
    • If you have a predefined DSN as shown in the Pro Drivers Installation section, you can connect using a DSN name, for example:

      R Console
      con <- DBI::dbConnect(odbc::odbc(), "DSN Name Here")

Use the pyodbc Python package to access your database with Python.

  • From the terminal, install the pyodbc package:

    pip install pyodbc

    Per the pyodbc installation documentation,

    Starting with pyodbc 4.0.35, Linux wheels are available from PyPI. However, they don’t include their own copies of the unixODBC library files (because that caused problems), so if pip installs pyodbc from those wheel files then unixODBC must be installed separately. Ensure you have unixodbc installed on the server.

Test connectivity

  • Test your connection in Python with pyodbc.connect
    • If you are using credentials to connect to a database, include them either as a connection string or as keyword arguments, for example:

      Python Interpreter
      import pyodbc
      con=pyodbc.connect(driver='{Driver Name}',
                         database='Database',
                         uid='User',
                         pwd='Password',
                         server='Server',
                         port=5432)
    • If you have a predefined DSN as shown in the Pro Drivers Installation section, you can connect using a DSN name, for example:

      Python Interpreter
      import pyodbc
      con=pyodbc.connect('DSN=DSN Name Here')

Additional Resources

Visit the Solutions site for best practices, examples, and additional configurations to use when working with databases and the Posit Professional Drivers.

Uninstallation

  • Use the following commands to uninstall the Posit Professional Drivers:
sudo yum remove rstudio-drivers
sudo apt-get remove rstudio-drivers
sudo zypper rm rstudio-drivers

Troubleshooting

Refer to Troubleshooting Posit Professional Drivers for additional information on troubleshooting the Connections pane in RStudio (the IDE).

Back to top