SHARE
TWEET

Untitled

a guest May 23rd, 2018 83 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ```
  2. #!/usr/bin/env bash
  3.  
  4. user=$1
  5. password=$2
  6.  
  7. declare -a dbs=("test1" "test2")
  8.  
  9. for db in "${dbs[@]}"
  10. do
  11.     db="db_$db"
  12.     echo "初始化 $db"
  13.     mysql -u$user -p$password -e "drop database if exists $db;create database $db;use $db;source ./sql/$db.sql;"
  14. done
  15.  
  16. ```
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top