daily pastebin goal
6%
SHARE
TWEET

Untitled

a guest Dec 23rd, 2017 47 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2.  
  3. # ... use parameters to get db name and password
  4. # build the mysqldump command and execute it...
  5.  
  6. command="mysqldump -alv -h127.0.0.3 --default-character-set=utf8 -u ${database} -p'${pw}' --extended-insert ${database} | gzip > ${path}"
  7. echo "$command"
  8. echo ""
  9. $command
  10.    
  11. $ ./dbbak DBUSER DBNAME PASSWORD
  12. mysqldump -alv -h127.0.0.3 --default-character-set=utf8 -u DBUSER -p'PASSWORD' --extended-insert DBNAME | gzip > /path/to/backup/backup.sql.gz
  13.  
  14. Warning: Using a password on the command line interface can be insecure.
  15. -- Connecting to 127.0.0.3...
  16. mysqldump: Got error: 1045: Access denied for user 'DBUSER'@'localhost' (using password: YES) when trying to connect
  17.    
  18. result=$(mysqldump -alv -h127.0.0.3 --default-character-set=utf8 -u ${database} -p'${pw}' --extended-insert ${database} | gzip > ${path})
  19.    
  20. ...
  21. ++ mysqldump -alv -h127.0.0.3 --default-character-set=utf8 -u DBUSER '-p'''DBPASS'''' --extended-insert DBNAME
  22.    
  23. mysqldump --defaults-file=~/my_mysql.cnf db table > table.sql
  24.    
  25. [mysqldump]
  26. user=user_name
  27. password=my_password
  28. host=my_host
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