1.mysqldump导出采用xz压缩
mysqldump -h localhost -uroot -pmypwd db_openproject_new --default-character-set=utf8 --set-gtid-purged=OFF --skip-tz-utc --skip-disable-keys --skip-add-locks |xz >/home/hxl/bakmysql/db_openproject_new_20200713_02.xz
2.压缩具体文件
xz -z 要压缩的文件
[root@hadoop-slave1 tmp]# xz -z dblist.txt
[root@hadoop-slave1 tmp]# ls
dblist.txt.xz
3.加压具体文件
xz -d 要解压的文件
[root@hadoop-slave1 tmp]# xz -d dblist.txt.xz
[root@hadoop-slave1 tmp]# ls
dblist.txt