41
39

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

[mysql] ダンプ・リストアする時にzcatコマンドを使って容量の圧迫を抑える

Posted at

mysqlのデータをダンプしてリストアしたい時にデータベースの容量が大きいと容量圧迫してしまう。そんなときgzファイルでdumpしたファイルを一度展開するのではなく、zcatコマンドを使って展開しながらリストアすると便利。

dump

mysqldump -u username -ppassword database_name | gzip > dumpfile.sql.gz

restore

zcat dumpfile.sql.gz | mysql -u username -ppassword database_name
41
39
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
41
39

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?