Skip to content

Password authentication error with Amazon Redshift if certain characters are present in the password #616

Description

@shalini1017
library(odbc)
con <- dbConnect(odbc::odbc(), 
driver = "Redshift", 
server = abc.redhsift.amazonaws.com, 
database = db_name, 
uid = abc,
pwd = password,
port = 1234)

returns
Error: nanodbc/nanodbc.cpp:1135: 0000: [RStudio][AmazonRedshift] (10) Error occured while trying to connect: [SQLState 28000] connection to server "abc.redhsift.amazonaws.com" , port 1234 failed: FATAL: password authentication failed for user "abc".

I do not see this error when I try connecting to Redshift using Python. My observation is that the whenever the Redshift password contains the characters []{}(),;?*=!@ it fails with the above error. The Redshift documentation here suggests to wrap the password inside curly braces {} whenever these characters are present but wrapping them inside curly braces does not work with odbc.

Database

Amazon Redshift

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions