Posted On March 28, 2019

mysqldump & gunzip

kimconnect 0 comments
blog.KimConnect.com >> Database , Linux >> mysqldump & gunzip
Create SQL Dump:
# Higher compression if bzip2 is installed on the system
# mysqldump -uwebadmin -p –all-databases | bzip2 > kimconnect.sql.bz2
mysqldump -uwebadmin -p –all-databases | gzip > kimconnect.sql.gz
 
Uncompress and import:
# If compressed by bzip2
# bunzip2 < kimconnect.sql.bz2 | mysql -uwebadmin -p
gunzip < kimconnect.sql.gz | mysql -uwebadmin -p

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

Linux: Bash Shell Script To Move/Archive Old Files

# create a script to move files (notice the regex escape for special chars) sudo…

Network Time Protocol for CentOS 8

Check hardware clock [root@sftp testadmin]# hwclock --verbosehwclock from util-linux 2.32.1System Time: 1608158426.341727Trying to open: /dev/rtc0Using…

MS SQL: Archive and Shrink Database

--Archive Database: with maximum allowed runtime and a set number of recordsdeclare @EndDate datetime, @Recs…