mirror of
https://github.com/muerwre/muerwre.github.io.git
synced 2025-04-24 18:36:41 +07:00
15 lines
393 B
Markdown
15 lines
393 B
Markdown
If you need to seed `.sql` dump in #docker container, just run this command. Also you can try to [rsync file with SSH](/linux/Rsync%20file%20with%20SSH) to get it from remote host.
|
|
|
|
```shell
|
|
#####
|
|
# usage: ./script.sh "/path/to/dump.sql"
|
|
#####
|
|
|
|
DUMP_PATH=$1
|
|
CONTAINER="db"
|
|
USER=root
|
|
PASSWORD=password
|
|
DB=database
|
|
|
|
cat "$DUMP_PATH" | docker exec -i $CONTAINER mysql -u$USER -p$PASSWORD $DB
|
|
```
|