User guide
3. At a command prompt, specify the connection information by using either command line parameters
or a connection information string. To use parameters:
psql -h <endpoint> -U <userid> -d <databasename> -p <port>
Where:
• <endpoint> is the Endpoint you recorded in the previous step.
• <userid> is a user ID with permissions to connect to the cluster.
• <databasename> is the Database Name you recorded in the previous step.
• <port> is the Port you recorded in the previous step.
For example:
psql -h examplecluster.<XXXXXXXXXXXX>.us-west-2.redshift.amazonaws.com -U
masteruser -d dev -p 5439
4. At the psql password prompt, enter the password for the <userid> user.
You are connected to the cluster, and you can interactively enter commands.
Connect by Using a Certificate
To control whether psql authenticates the service using a certificate, you must use a connection information
string to specify connection information, and specify the sslmode keyword. By default, psql operates
with sslmode=prefer.To specify that psql opens an encrypted connection and uses an Amazon Redshift
certificate to verify the service, download an Amazon Redshift certificate to your computer, specify
sslmode=verify-ca, and specify sslrootcert with the location of the certificate. For more information
about sslmode, see Configure Security Options for Connections (p. 158).
API Version 2012-12-01
167
Amazon Redshift Management Guide
Connecting to Clusters From Client Tools and Code