-- dump 导出备份 并压缩
mysqldump -h -u root -p –password tablename | gzip > /usr/local/db_backup/tablename-`date +%Y%m%d%H%M%S`.sql.gz
-- 解压
gzip -d tablename-20220xxxxx0000.sql.gz
-- 导入数据
mysql -h localhost -p3306 -uroot –password tablename < /usr/local/db_backup/tablename-20220xxxxx0000.sql
导入不用mysqldump,而是用mysql命令