How to connect to redshift database from Command Line using psql

Step1: Download and install psql tool from for your version of OS.

For Linux:

sudo yum install -y 

sudo yum install postgresql14

Step2: Copy the endpoint, database name, port information from AWS Management console for your Redshift database and use the below connection string to connect to the database. You will be prompted to enter the password for your specified ‘username‘.

psql -h <endpoint> -U <username> -d <databasename> -p <port>
See also  How to encrypt an EBS volume