Menu
Amazon Redshift
Getting Started Guide (API Version 2012-12-01)

Step 5: Connect to the Sample Cluster

Now you will connect to your cluster by using a SQL client tool and run a simple query to test the connection. You can use most SQL client tools that are compatible with PostgreSQL. For this tutorial, you’ll use the SQL Workbench/J client that you installed in the prerequisites section of this tutorial. Complete this section by performing the following steps:

After you complete this step, you can determine whether you want to load sample data from Amazon S3 in Step 6: Load Sample Data from Amazon S3 or find more information about Amazon Redshift and reset your environment at Where Do I Go From Here?.

To Get Your Connection String

  1. In the Amazon Redshift console, in the navigation pane, choose Clusters.

  2. Choose examplecluster to open it, and make sure you are on the Configuration tab.

  3. On the Configuration tab, under Cluster Database Properties, copy the JDBC URL of the cluster.

    Note

    The endpoint for your cluster is not available until the cluster is created and in the available state.

To Connect from SQL Workbench/J to Your Cluster

This step assumes you installed SQL Workbench/J in Step 1: Set Up Prerequisites.

  1. Open SQL Workbench/J.

  2. Choose File, and then choose Connect window.

  3. Choose Create a new connection profile.

  4. In the New profile text box, type a name for the profile.

  5. Choose Manage Drivers. The Manage Drivers dialog opens.

  6. Choose the Create a new entry button. In the Name text box, type a name for the driver.

    Choose the folder icon next to the Library box, navigate to the location of the driver, select it, and then choose Open.

    If the Please select one driver dialog box displays, select com.amazon.redshift.jdbc4.Driver or com.amazon.redshift.jdbc41.Driver and choose OK. SQL Workbench/J automatically completes the Classname box. Leave the Sample URL box blank, and then choose OK.

  7. In the Driver box, choose the driver you just added.

  8. In URL, copy the JDBC URL from the Amazon Redshift console and paste it here.

  9. In Username, type masteruser.

  10. In Password, type the password associated with the master user account.

  11. Choose the Autocommit box.

  12. Choose the Save profile list icon, as shown below:

  13. Choose OK.