Last active
June 12, 2022 20:21
-
-
Save chris2k20/c30a0f82443205ee9f9c0e67fab550c6 to your computer and use it in GitHub Desktop.
Run a mysql_upgrade in all mysql/mariadb docker containers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# run the following command in your terminal to: | |
# - run a mysql_upgrade command in every container | |
# - kill the container to restart the mariadb | |
for x in $(docker ps | grep -i mariadb:latest | awk '{print $1;}'); do echo container $x now updating...; docker exec $x bin/sh -c 'mysql_upgrade --user=root --password=$(printenv MYSQL_ROOT_PASSWORD) ; kill 1'; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment