I was wondering if anyone knew whether the above was likely to be achievable or if I'm doing something nonsensical. These connection details work to an RDS (i.e. blah.blah.eu-west-1.rds.amazonaws.com) database:
'db1' => [
'driver' => 'pgsql',
'host' => env('DB_HOST_BRAIN'),
'database' => env('DB_DATABASE_BRAIN'),
'username' => env('DB_USERNAME_BRAIN'),
'password' => env('DB_PASSWORD_BRAIN'),
'charset' => 'utf8',
'prefix' => '',
'schema' => 'xyz_admin',
],
but these do not work to a Redshift (i.e. blah.blah.eu-west-1.redshift.amazonaws.com) database:
'db2' => [
'driver' => 'pgsql',
'host' => env('DB_HOST_PINKY'),
'database' => env('DB_DATABASE_PINKY'),
'username' => env('DB_USERNAME_PINKY'),
'password' => env('DB_PASSWORD_PINKY'),
'port' => env('DB_PORT_PINKY'),
'charset' => 'utf8',
'prefix' => '',
'schema' => 'xyz',
],
Assuming all the details are correct, is there a compelling reason why this is never going to work? Is there any way I can make it work?
Amazon Redshift is based on PostgreSQL. Amazon Redshift and PostgreSQL have a number of very important differences that you must be aware of as you design and develop your data warehouse applications.
You must install the Amazon Redshift ODBC driver on client computers accessing an Amazon Redshift data warehouse.
The Amazon Redshift ODBC Driver is a powerful tool that allows you to connect with live Amazon Redshift data, directly from any applications that support ODBC connectivity. Read, write, and update Amazon Redshift data through a standard ODBC Driver interface.
As long as the environment variables are correct, your config works for connecting to Redshift:
$take_over_the_world = DB::connection('db2')->select('SELECT tonight FROM going_to_do');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With