使用 R 通过 SSL 连接到 Redshift
Connect to Redshift via SSL using R
我目前正在尝试连接到 R 中的 redshift 数据库。这需要通过 SSL 连接完成,但我似乎无法找到指定要在 [= 中使用的证书文件路径的选项10=]。 Google 也没有提供足够的帮助。
通过 R 建立 postgres SSL 连接到 redshift 真的那么难,还是我只是错过了一些基本的东西?
只需做:
host = 'redshift-name.xxxxxxxxxxxx.eu-west-1.redshift.amazonaws.com'
dbname = 'your_db_name'
port = 3306
password = 'hunter2'
username = 'rs_user'
redshift_cert = paste0(FILE_PATH, 'redshift-ssl-ca-cert.pem')
pg_dsn = paste0(
'dbname=', dbname, ' ',
'sslrootcert=', redshift_cert, ' ',
'sslmode=verify-full'
)
dbConnect(RPostgreSQL::PostgreSQL(), dbname=pg_dsn, host=host, port=port, password=password, user=username)
我目前正在尝试连接到 R 中的 redshift 数据库。这需要通过 SSL 连接完成,但我似乎无法找到指定要在 [= 中使用的证书文件路径的选项10=]。 Google 也没有提供足够的帮助。
通过 R 建立 postgres SSL 连接到 redshift 真的那么难,还是我只是错过了一些基本的东西?
只需做:
host = 'redshift-name.xxxxxxxxxxxx.eu-west-1.redshift.amazonaws.com'
dbname = 'your_db_name'
port = 3306
password = 'hunter2'
username = 'rs_user'
redshift_cert = paste0(FILE_PATH, 'redshift-ssl-ca-cert.pem')
pg_dsn = paste0(
'dbname=', dbname, ' ',
'sslrootcert=', redshift_cert, ' ',
'sslmode=verify-full'
)
dbConnect(RPostgreSQL::PostgreSQL(), dbname=pg_dsn, host=host, port=port, password=password, user=username)