daily pastebin goal
66%
SHARE
TWEET

Untitled

a guest Aug 14th, 2016 210 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2.  
  3. ## CONF ##
  4. DBUSER=mangos
  5. DBPASSWORD=mangos
  6. DBSERVER=localhost
  7. ############
  8. DBSNAME="$1"
  9. DBNAME="$2"
  10.  
  11. if [ "$DBSNAME" ] && [ "$DBNAME" ]; then
  12.   read -n1 -r -p "Press SPACE to start COPY db \"${DBSNAME}\" to \"${DBNAME}\" or CTRL+C to EXIT" KEY
  13.   if [ "$KEY" = '' ]; then
  14.     mysql_config_editor set --login-path=local --host=$DBSERVER --user=$DBUSER --password=$DBPASSWORD
  15.     echo "Copying database ... (may take a while ...)"
  16.     mysqldump $DBSNAME | mysql $DBNAME
  17.   fi
  18. fi
  19.  
  20. if [ "$1" = "help" -o "$1" = "-help" -o "$1" = "-h" -o "$1" = "" -o "$2" = "" ]; then
  21.   echo ""
  22.   echo "Command: ./copyDB sourceDB targetDB"
  23.   echo ""
  24. fi
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