Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function resetdb()
- {
- host="asdf"
- user="asdf"
- passwd="asdf"
- database=( "asdf" "asdf")
- for db in "${database[@]}"; do
- read -r -d '' -a tables < <(mysql -u$user -p$passwd -h$host $db -B -s -e 'show tables');
- (IFS=,; echo "DROP TABLE ${tables[*]};") | mysql -v -u$user -p$passwd -h$host $db;
- mysql -u$user -p$passwd -h$host $db < ../../../database/$db.sql;
- mysql -u$user -p$passwd -h$host $db < ../../../database/demo.sql;
- done
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement