This is the Bitnami Drupal solution that I deployed on AWS
As you know, this image comes with Drupal 8.6.4 preinstalled but we need to install our custom modules. To do so, we install everything via Composer (this is what Drupal community recommends).
Once of the commands used is "composer update", this will make sure all packages are up to date.
The Bitnami image comes with Drush version: 8.1.17 but the after the update command Drush gets update to 9.5.2. .
You can run "composer update" on a new Bitnami install inside the Drupal folder "/home/bitnami/apps/drupal/htdocs" and you can see that Drush gets updated and it stops working.
Here's a set of commands you can run inside the Drupal install folder:
drush status --> this will generate a list of configurations for Drush
drush sql-connect --> will display the Mysql connection (it reads the config file located under
/sites/default/settings.php inside the Drupal folder)
My install returns the correct MySQL connection. If I use that string then I'm able to list all databases and tables.
drush dbupdate --> will connect to Drupal and run the updates on the database. These types of commands stop working after
You can run the above command with --debug flag at the end and you'll get an error like this:
[bootstrap] Drush was not able to start (bootstrap) the Drupal database.
Hint: This may occur when Drush is trying to:
* bootstrap a site that has not been installed or does not have a configured database.
I hope this helps. Please let me know if you need more info.