Amazon Redshift
Driver Options
Amazon - The Amazon AWS website provides instructions on how to download and setup their driver: Configure an ODBC Connection
Posit Professional Drivers - Workbench, RStudio Desktop Pro, Connect, or Shiny Server Pro users can download and use Posit Professional Drivers at no additional charge. These drivers include an ODBC connector for Redshift databases. Posit delivers standards-based, supported, professional ODBC drivers. Use Posit Professional Drivers when you run R or Shiny with your production systems. See the Posit Professional Drivers for more information.
Package Options
The odbc
package, in combination with a driver, provides DBI
support and an ODBC connection.
Connection Settings
There are six settings needed to make a connection:
Driver
- See the Drivers section for setup informationservername
- A network path to the database serverdatabase
- The name of the schemaUID
- The user’s network ID or server local accountPWD
- The account’s passwordPort
- Should be set to 5439
<- DBI::dbConnect(odbc::odbc(),
con Driver = "[your driver's name]",
servername = "[your server's path]",
database = "[your database's name]",
UID = rstudioapi::askForPassword("Database user"),
PWD = rstudioapi::askForPassword("Database password"),
Port = 5439)