Skip to content

Instantly share code, notes, and snippets.

@victorbalssa
Last active March 16, 2024 20:27
Show Gist options
  • Save victorbalssa/babd008974b464b80ab7c05082fc490b to your computer and use it in GitHub Desktop.
Save victorbalssa/babd008974b464b80ab7c05082fc490b to your computer and use it in GitHub Desktop.
# --- One liner: MySQL Dump with docker --- #
$ /usr/bin/docker exec -it `your container name` /usr/bin/mysqldump -u `mysql user` --password=`mysql password` `mysql database` > backup.sql
# --- #
# --- One liner: MariaDB SQL Dump with docker --- #
$ /usr/bin/docker exec `your container name` /usr/bin/mariadb-dump -u `mariadb user` --password=`mariadb password` `mariadb database` > mariadb_backup.sql
# --- #
# --- One liner: SQL import with docker --- #
$ /usr/bin/docker exec -i `your container name` mysql -u root --password=`mysql password` `mysql database` < backup.sql
# --- #
# MARIADB
$ /usr/bin/docker exec -i `your container name` mariadb -u root --password=`mariadb password` `mariadb database` < backup.sql
# --- #
# --- One liner: docker-compose up + rebuild with cache + use .env.local file + override with .prod.yml --- #
$ docker compose -f docker-compose.yml -f docker-compose.prod.yml --env-file .env.local up -d --build
# --- #
# --- check / usage --- #
$ du -h -x -d 1 /
# --- #
# --- net stat --- #
$ netstat -nltp
# --- #
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment