Skip to content

Instantly share code, notes, and snippets.

@potados99
Last active December 1, 2020 09:40
Show Gist options
  • Save potados99/33d9a632930fcb11e16c63a04b2f502e to your computer and use it in GitHub Desktop.
Save potados99/33d9a632930fcb11e16c63a04b2f502e to your computer and use it in GitHub Desktop.

백업

$ mysqldump -u [사용자 계정] -p [패스워드] --no-tablespaces --column-statistics=0 [원본 데이터베이스명] > [생성할 백업 DB명].sql
$ mysqldump -u potados -p 1234 --no-tablespaces --column-statistics=0 cafeteria > backedup.sql

mysqldump 8부터 --no-tablespaces --column-statistics=0 옵션을 주어야 함.

복원

$ mysql -u [사용자 계정] -p [패스워드] [복원할 DB] < [백업된 DB].sql
$ mysql -u potados -p 1234 cafeteria < .sql
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment