15 lines
291 B
Text
15 lines
291 B
Text
|
#!/bin/zsh
|
||
|
|
||
|
echo -n 'Database root PW (for DB manipulation): '
|
||
|
read -s ROOTPW
|
||
|
echo
|
||
|
|
||
|
mysql -u root -p"$ROOTPW" -B <<EOF
|
||
|
DROP DATABASE $2; CREATE DATABASE $2;
|
||
|
EOF
|
||
|
echo "Recreated database $2"
|
||
|
|
||
|
mysqldump -u root -p"$ROOTPW" "$1" \
|
||
|
| mysql -u root -p"$ROOTPW" -B "$2"
|
||
|
echo "Copied $1 to $2"
|