Prerequisites
Before proceeding, ensure the following prerequisites are met:- Install MindsDB locally via Docker or Docker Desktop.
- To connect Redshift to MindsDB, install the required dependencies following this instruction.
Connection
Establish a connection to your Redshift database from MindsDB by executing the following SQL command:host
: The host name or IP address of the Redshift cluster.port
: The port to use when connecting with the Redshift cluster.database
: The database name to use when connecting with the Redshift cluster.user
: The username to authenticate the user with the Redshift cluster.password
: The password to authenticate the user with the Redshift cluster.
schema
: The database schema to use. Default is public.sslmode
: The SSL mode for the connection.
Usage
Retrieve data from a specified table by providing the integration name, schema, and table name:The above examples utilize
redshift_datasource
as the datasource name, which is defined in the CREATE DATABASE
command.Troubleshooting Guide
Database Connection Error
- Symptoms: Failure to connect MindsDB with the Amazon Redshift cluster.
- Checklist:
- Make sure the Redshift cluster is active.
- Confirm that host, port, user, password and database are correct. Try a direct Redshift connection using a client like DBeaver.
- Ensure that the security settings of the Redshift cluster allow connections from MindsDB.
- Ensure a stable network between MindsDB and Redshift.
SQL statement cannot be parsed by mindsdb_sql
- Symptoms: SQL queries failing or not recognizing table names containing spaces or special characters.
- Checklist:
- Ensure table names with spaces or special characters are enclosed in backticks.
- Examples:
- Incorrect: SELECT * FROM integration.travel data
- Incorrect: SELECT * FROM integration.‘travel data’
- Correct: SELECT * FROM integration.`travel data`