docs: specify root username in mysql dump instructions

The default user in the mysql container is 'mysql',
so the `mysql` command tries to use the 'mysql' MySQL user by default.

But, in the MySQL dump instructions,
we are providing the MySQL root user's password, so we need
to specify `MYSQL_ROOT_USERNAME` as the MySQL user when invoking `mysql`.
This commit is contained in:
Kyle McCormick 2022-05-19 12:50:18 -04:00 committed by Régis Behmo
parent 78424776b6
commit 57108bdf76
1 changed files with 4 additions and 2 deletions

View File

@ -25,8 +25,10 @@ Making database dumps
To dump all data from the MySQL and Mongodb databases used on the platform, run the following commands::
tutor local exec -e MYSQL_ROOT_PASSWORD="$(tutor config printvalue MYSQL_ROOT_PASSWORD)" mysql \
sh -c 'mysqldump --all-databases --password=$MYSQL_ROOT_PASSWORD > /var/lib/mysql/dump.sql'
tutor local exec \
-e USERNAME="$(tutor config printvalue MYSQL_ROOT_USERNAME)" \
-e PASSWORD="$(tutor config printvalue MYSQL_ROOT_PASSWORD)" \
mysql sh -c 'mysqldump --all-databases --user=$USERNAME --password=$PASSWORD > /var/lib/mysql/dump.sql'
tutor local exec mongodb mongodump --out=/data/db/dump.mongodb
The ``dump.sql`` and ``dump.mongodb`` files will be located in ``$(tutor config printroot)/data/mysql`` and ``$(tutor config printroot)/data/mongodb``.