Advertisement
Guest User

Untitled

a guest
Aug 14th, 2016
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement