Skip to content

Instantly share code, notes, and snippets.

View dominik-pakosz's full-sized avatar

Dominik Pakosz dominik-pakosz

View GitHub Profile
@devdrops
devdrops / example.md
Last active March 25, 2024 15:09
Mysqldump from Docker container

Mysqldump from Docker container

docker exec -i mysql_container mysqldump -uroot -proot --databases database_name --skip-comments > /path/to/my/dump.sql

OBS

  • This will generate a dump.sql file in your host machine. Awesome, eh?
  • Avoid using --compact on your dump. This will make MySQL check your constraints which will cause troubles when reading your file (damm you MySQL). And don't use --force to fix this scenario: recreate your dump without --compact ¯_(ツ)_/¯