Created
June 12, 2024 13:08
-
-
Save DominikStyp/8c8ec401cea887a0043abdb84f336d09 to your computer and use it in GitHub Desktop.
Import database to MySQL docker container
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
DB_CONTAINER_NAME = 'mysql-container-1' | |
DB_PASSWORD = 'secret' | |
DB_NAME = 'db' | |
DB_USER = 'db_user' | |
DB_PORT = 3306 | |
DB_HOST = 'db-host' | |
docker exec -i $DB_CONTAINER_NAME mysql -h $DB_HOST -P $DB_PORT -u $DB_USER -p$DB_PASSWORD $DB_NAME < dump.sql |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment