heroku-wp icon indicating copy to clipboard operation
heroku-wp copied to clipboard

Error establishing a database connection

Open janoist1 opened this issue 5 years ago • 6 comments

I'm getting Error establishing a database connection when installing WP.

The following prints "Connected" when putting intowp-config.php:

$mysqli_connection = mysqli_connect(
  $_dbsettings['host'],
  $_dbsettings['user'],
  $_dbsettings['pass'],
  trim( $_dbsettings['path'], '/' ),
  $_dbsettings['port']
);

if ($mysqli_connection->connect_error) {
   echo "Not connected, error: " . $mysqli_connection->connect_error;
}
else {
   echo "Connected.";
}

What's going on?

janoist1 avatar Feb 21 '20 19:02 janoist1

This is due to the RDS certificate change.

From jawsdb.com: image

You'll need to swap out this file in your repo support/mysql-certs/rds-combined-ca-bundle.pem with this new one from AWS:

https://s3.amazonaws.com/rds-downloads/rds-combined-ca-bundle.pem

and redeploy.

nickmerwin avatar Feb 26 '20 15:02 nickmerwin

Pull Request opened: https://github.com/xyu/heroku-wp/pull/171

nickmerwin avatar Feb 26 '20 15:02 nickmerwin

👍👍👍👍👍👍👍👍👍👍👍👍👍👍👍

janoist1 avatar Feb 26 '20 15:02 janoist1

thanks a million I overlooked the update

DSaxon avatar Mar 18 '20 23:03 DSaxon

there are a few pulls that i think is pending. Is anyone on this thread able to help keep the repo updated?

DSaxon avatar Mar 18 '20 23:03 DSaxon

Switch WP_DB_SSL to OFF from Heroku's Settings Tab -> Config Vars

lilpkstud avatar Jun 07 '20 23:06 lilpkstud