Access Amazon Redshift data from Python

Amazon Redshift
import redshift_connector
con=redshift_connector.connect(
host='host_name',
database='db_name',
user='user_name',
password='itsasecret'
)
  • Host Name
  • Database Name
  • User Name
  • Password
with conn.cursor() as cursor:
cursor.execute("Select * from Your_Table_Name")
result: tuple = cursor.fetchall()
print(result)

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store