Invalid database type. Supported types are mysql and sqlite3. Current Value(s): mysql2

When attempting to stop a server after updating from Ghost 4.48.1 to Ghost 5.2.2, I encountered the following error. This same thing happened for every site that I updated.

stephen@bau:/var/www/builderscollective.com$ ghost stop

Love open source? We’re hiring Node.js Engineers to work on Ghost full-time.
https://careers.ghost.org/product-engineer-node-js


+ sudo systemctl is-active ghost_builderscollective-com
+ sudo systemctl stop ghost_builderscollective-com
✔ Stopping Ghost: builderscollective-com
stephen@bau:/var/www/builderscollective.com$ ghost start

Love open source? We’re hiring Node.js Engineers to work on Ghost full-time.
https://careers.ghost.org/product-engineer-node-js


+ sudo systemctl is-active ghost_builderscollective-com
✔ Checking system Node.js version - found v14.19.3
✔ Ensuring user is not logged in as ghost user
✔ Checking if logged in user is directory owner
✔ Checking current folder permissions
+ sudo systemctl is-active ghost_builderscollective-com
✖ Validating config
✔ Checking folder permissions
✔ Checking file permissions
✔ Checking content folder ownership
✔ Checking memory availability
✔ Checking binary dependencies
✔ Checking systemd unit file
✔ Checking systemd node version - found v14.19.3
One or more errors occurred.

1) Validating config

Error detected in the production configuration.

Message: Invalid database type. Supported types are mysql and sqlite3
Configuration Key(s): database.client
Current Value(s): mysql2

Help: Run `ghost config <key> <new value>` for each key to fix the issue.


Debug Information:
    OS: Ubuntu, v20.04.2 LTS
    Node Version: v14.19.3
    Ghost Version: 5.2.2
    Ghost-CLI Version: 1.21.0
    Environment: production
    Command: 'ghost start'

Try running ghost doctor to check your system for known issues.

You can always refer to https://ghost.org/docs/ghost-cli/ for troubleshooting.

I fixed the issue by modifying the config.production.json file to change the database client value to mysql instead of mysql2. This change solved the issues for me.

The config.production.json was changed from this:

  "database": {
    "client": "mysql2",

to this:

  "database": {
    "client": "mysql",