Skip to content

Instantly share code, notes, and snippets.

@DominikStyp
Created June 12, 2024 13:08
Show Gist options
  • Save DominikStyp/8c8ec401cea887a0043abdb84f336d09 to your computer and use it in GitHub Desktop.
Save DominikStyp/8c8ec401cea887a0043abdb84f336d09 to your computer and use it in GitHub Desktop.
Import database to MySQL docker container
#!/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