导入 Python 连接器 - Amazon Redshift
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅 中国的 Amazon Web Services 服务入门 (PDF)

导入 Python 连接器

要导入 Python 连接器,请运行以下命令。

>>> import redshift_connector

要使用 Amazon 凭证连接到 Amazon Redshift 集群,请运行以下命令。

conn = redshift_connector.connect( host='examplecluster.abc123xyz789.us-west-1.redshift.amazonaws.com', port=5439, database='dev', user='awsuser', password='my_password' )