Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /bin/bash
- USER="user"
- PASS="password"
- DB="database";
- FIRST_LINE=1
- for x in $(mysql -u $USER --password=$PASS --execute='SHOW TABLES' $DB); do
- # skip the first line which is 'Tables_in_$DB'
- if [ $FIRST_LINE -eq 1 ]; then
- FIRST_LINE=0
- continue
- fi
- mysqldump --add-drop-table --add-locks --comments --disable-keys --dump-date --extended-insert --no-create-db --order-by-primary --quote-names -u $USER --password=$PASS $DB $x > $x.sql
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement