Skip to content

Instantly share code, notes, and snippets.

@jaircuevajunior
Created June 16, 2025 18:24
Show Gist options
  • Save jaircuevajunior/2bbea669bf5208d9c738d240d694ef8c to your computer and use it in GitHub Desktop.
Save jaircuevajunior/2bbea669bf5208d9c738d240d694ef8c to your computer and use it in GitHub Desktop.
Create a dump using docker mysql official image
export HOST=myhost-database.com
export USER=root
export PASS='mypassword123456'
export DB=my_database

docker run --rm \
	-e MYSQL_PWD="$PASS" \
	mysql:8 mysqldump -h $HOST -u $USER $DB > dump.sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment