Advertisement
Guest User

Untitled

a guest
Feb 28th, 2017
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. DB_host=host
  2. DB_user=username
  3. DB=database
  4. DIR=directory
  5. DB_pass=password
  6.  
  7. tbl_count=0
  8. for t in $(mysql -NBA -h $DB_host -u $DB_user -p$DB_pass -D $DB -e 'show tables')
  9. do
  10. echo "DUMPING TABLE: $DB.$t"
  11. mysqldump -h $DB_host -u $DB_user -p$DB_pass $DB $t > $DIR/$DB.$t.sql
  12. tbl_count=$(( tbl_count + 1 ))
  13. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement