Created
December 18, 2014 13:44
-
-
Save rifki/03af2da750685baefb23 to your computer and use it in GitHub Desktop.
Dumping DB & Table
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
########################## | |
Dump Table | |
########################## | |
mysqldump -hhostnya -uusernya -p namadbnya tablenya1 tablenya2 > /path/to/hasilnya.sql | |
########################## | |
Dump Database | |
########################## | |
mysqldump -hmyhostname -uusernya -p namadbnya > targetfilenya.sql | |
########################## | |
Dump Database with compress | |
########################## | |
mysqldump -hmyhostname -uusernya -p namadbnya | bzip2 > hasilnya.bz2 | |
########################## | |
Download hasil dumping | |
########################## | |
rsync -azv -e usename@ip:/home/username/db11272014.bz2 ~/Desktop/ -e "ssh -p 22220" | |
########################## | |
Dumping of latest 10 records | |
########################## | |
mysqldump --where="TRUE ORDER BY id DESC LIMIT 10" -hhostnya -uusernya -p namadbnya user > ~/hasilnya.sql | |
########################## | |
Dumping where option | |
########################## | |
--where="TRUE ORDER BY id DESC LIMIT 1000" | |
--where="TRUE LIMIT 500" | |
--where="mailbox_id=45" | |
--where="mailbox_id=45 AND TRUE ORDER BY id DESC LIMIT 300" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment