티스토리 뷰
728x90
반응형
Cheat Sheet
---
tags: [ database ]
---
# To dump a database to a file (Note that your password will appear in your command history!):
mysqldump -u<username> -p<password> <database> > db.sql
# To dump a database to a file:
mysqldump -u<username> -p <database> > db.sql
# To dump a database to a .tgz file (Note that your password will appear in your command history!):
mysqldump -u<username> -p<password> <database> | gzip -9 > db.sql
# To dump a database to a .tgz file:
mysqldump -u<username> -p <database> | gzip -9 > db.sql
# To dump all databases to a file (Note that your password will appear in your command history!):
mysqldump -u<username> -p<password> --all-databases > all-databases.sql
# To dump all databases to a file:
mysqldump -u<username> -p --all-databases > all-databases.sql
# To export the database structure only:
mysqldump --no-data -u<username> -p <database> > dump_file
# To export the database data only:
mysqldump --no-create-info -u<username> -p <database> > dump_file
더 보기
https://dev.mysql.com/doc/refman/8.0/en/mysqldump.html
728x90
반응형
'개발환경 > DB' 카테고리의 다른 글
[H2 Database] Mac에 H2Database 설치하는 방법 (34) | 2024.03.14 |
---|---|
[mongoDB] linux mongoDB 주기적으로 백업하는 방법 (2) | 2023.01.27 |
[MongoDB] 몽고디비 ObjectId 그리고 날짜(datetime) 간의 변환(convert) 방법 (0) | 2022.04.07 |
[MySQL] ASCII() 와 ORD() 함수의 차이점 (0) | 2021.10.30 |
[mongoDB] ubuntu16.04 mongoDB 설치+실행+관리자만들기 (0) | 2021.10.27 |
댓글