@@ -412,12 +412,12 @@ To back up the database within the docker-based setup, you can run the
following command (no need to substitute ${MYSQL_ROOT_PASSWORD}, it's
already present within the container environment):
-docker-compose exec layersdb /bin/sh -c '/usr/bin/mysqldump -u root --password=${MYSQL_ROOT_PASSWORD} --max_allowed_packet=512M layersdb' | gzip > backup-`date +%Y_%m_%d_%H%M`.sql.gz
+docker-compose exec layersdb /bin/sh -c '/usr/bin/mariadb-dump -u root --password=${MYSQL_ROOT_PASSWORD} --max_allowed_packet=512M layersdb' | gzip > backup-`date +%Y_%m_%d_%H%M`.sql.gz
To restore one of these backups you would run the following command (take
care, this will overwrite the data immediately without prompting!):
-zcat backupfile.sql.gz | docker-compose exec -T layersdb /bin/sh -c '/usr/bin/mysql -u root --password=${MYSQL_ROOT_PASSWORD} layersdb'
+zcat backupfile.sql.gz | docker-compose exec -T layersdb /bin/sh -c '/usr/bin/mariadb -u root --password=${MYSQL_ROOT_PASSWORD} layersdb'
@@ -798,7 +798,7 @@ while True:
env = os.environ.copy()
env['MYSQL_PWD'] = dbapassword
# Dummy command, we just want to establish that the db can be connected to
- return_code = subprocess.call("echo | docker-compose exec -T -e MYSQL_PWD layersdb mysql -uroot layersdb", shell=True, env=env)
+ return_code = subprocess.call("echo | docker-compose exec -T -e MYSQL_PWD layersdb mariadb -uroot layersdb", shell=True, env=env)
if return_code == 0:
break
else:
@@ -820,7 +820,7 @@ if not args.update:
catcmd = 'cat'
env = os.environ.copy()
env['MYSQL_PWD'] = dbapassword
- return_code = subprocess.call("%s %s | docker-compose exec -T -e MYSQL_PWD layersdb mysql -uroot layersdb" % (catcmd, quote(args.databasefile)), shell=True, env=env)
+ return_code = subprocess.call("%s %s | docker-compose exec -T -e MYSQL_PWD layersdb mariadb -uroot layersdb" % (catcmd, quote(args.databasefile)), shell=True, env=env)
if return_code != 0:
print("Database import failed")
sys.exit(1)
@@ -848,7 +848,7 @@ if not args.update:
# (avoids password being visible through ps or /proc/<pid>/cmdline)
env = os.environ.copy()
env['MYSQL_PWD'] = dbapassword
- return_code = subprocess.call("docker-compose exec -T -e MYSQL_PWD layersdb mysql -uroot layersdb < " + quote(sqlscriptfile), shell=True, env=env)
+ return_code = subprocess.call("docker-compose exec -T -e MYSQL_PWD layersdb mariadb -uroot layersdb < " + quote(sqlscriptfile), shell=True, env=env)
if return_code != 0:
print("Creating database user failed")
sys.exit(1)
@@ -31,9 +31,9 @@ fi
# This will ask for the password twice, not much we can really do about
# that though
# First, get the structure without data
-mysqldump $1 -u root -p --no-data > $2
+mariadb-dump $1 -u root -p --no-data > $2
# Second, the data with a number of exclusions
-mysqldump $1 -u root -p --no-create-info \
+mariadb-dump $1 -u root -p --no-create-info \
--ignore-table=$1.auth_group \
--ignore-table=$1.auth_group_permissions \
--ignore-table=$1.auth_permission \
In the last versions of mariadb:lts docker container, the database management binaries are named mariadb* instead of mysql*. This requires some small modifications in our scripts. Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> --- README | 4 ++-- dockersetup.py | 6 +++--- layerindex/tools/initial_db_dump.sh | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-)