Changing Your Database Password¶
Changing the MySQL password for your
database service also affects the other services that must connect to the database.
Updating your database password requires a period of downtime for you to restore a backup to your database service, and then restart all of your services. Plan ahead to make time for this before rotating your database password.
Creating a Backup¶
If you are changing the password for a production environment, then you must ensure you have an up-to-date backup so you can restore it after the update.
To create a backup for any environment, click Backups from the menu on the left:
Then, click Backup Now on the Backups page:
Changing the Database Password¶
The database password is changed directly using the secrets feature within your chosen environment. However, for the database password secret, you must follow additional steps to ensure that your services update correctly with the new value.
When you are ready, follow these steps to change your database password:
Navigate to your chosen environment.
Click Settings from the menu on the left:
In the Secrets section, click Edit… from the Actions menu beside the
In the Value section, click Show beside the value to reveal the secret and enable editing.
Edit the value of the secret.
Scroll down and check all of the boxes acknowledging the effects of changing the value of the secret.
Click Publish secret.
The services attempt to restart when you click
Publish secret. However, the database service can only update its password upon image creation, so the service must be deleted and redeployed to update it.
Return to your environment’s Services page.
From the Actions menu for the
databaseservice, click Delete Service.
Open a command prompt within your local clone of the repository.
databaseservice to your environment using the command-line interface:
If you are not already logged in, enter
yat the prompt and authenticate with your browser.
When prompted, enter the number corresponding to your environment:
# Project Status 1 lfrlearn-infra Ready 2 lfrlearn-uat Ready 3 lfrlearn-dev Ready 4 lfrlearn-prd Ready ? Type a number (#) or project name: 2
The database service starts up using the updated password. The
backupservices restart to reconnect to the database service with the correct password, as well.
database service is now updated with a new password, and your other services are synchronized to connect to it properly.