Skip to content

Instantly share code, notes, and snippets.

View pmjhonwang's full-sized avatar
🎯
Focusing

pmjhonwang pmjhonwang

🎯
Focusing
View GitHub Profile
@pmjhonwang
pmjhonwang / mysql-docker.sh
Created February 2, 2023 13:45 — forked from spalladino/mysql-docker.sh
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
#!/bin/bash
# This script takes a remote repository and merges it into
# the current one as a subdirectory
set -e
if [ -z "$1" ]
then
echo "Usage:"