Mysql 导出

常规导出

常规导出导入
# 通过 gizp 压缩,
mysqldump -uroot -p -A -B | gzip > /tmp/mysql_all.tar.gz
  -A, --all-databases Dump all the databases. This will be same as --databases
                      with all databases selected.
					  导出所有数据库
					  
  -B, --databases     Dump several databases. Note the difference in usage; in
                      this case no tables are given. All name arguments are
                      regarded as database names. 'USE db_name;' will be
                      included in the output.
	gzip 压缩

# 解压缩,导入
gzip -d mysql_all.tar.gz
mysql -uroot -p < /tmp/mysql_all.tar
posted @ 2022-06-04 18:32  Star-Hitian  阅读(13)  评论(0编辑  收藏  举报