Skip to content

How to make database dump before closing (mysql) testcontainer #6801

Discussion options

You must be logged in to vote

Sorry for the delay. You should run container.execInContainer("mysqldump", "-u", container.getUsername(), "--password=" + container.getPassword(), container.getDatabaseName(), "--result-file=dump.sql");. You don't need the random port because it is running in the mysql instance itself.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@marceloverdijk
Comment options

Answer selected by marceloverdijk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants