Skip to content

Instantly share code, notes, and snippets.

@raisiqueira
Last active June 22, 2022 14:49
Show Gist options
  • Save raisiqueira/8b97faa34c45a7f206b977b000315088 to your computer and use it in GitHub Desktop.
Save raisiqueira/8b97faa34c45a7f206b977b000315088 to your computer and use it in GitHub Desktop.
MYSQL DUMP container Docker

Rodar o Container do MYSQL

docker run --name dump -p 3306:3306 -e MYSQL_ROOT_PASSWORD=root -d mysql

Importar .sql para o container:

docker exec -i <CONTAINER> mysql -uroot -pSENHA --database=dump < dump.sql

Exportar um .sql para o host:

docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment