14 lines
291 B
Bash
Executable file
14 lines
291 B
Bash
Executable file
#!/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"
|