반응형
Container 외부에서 MariaDB Data Backup
Container에 접속하지 않고 MariaDB 데이터를 SQL로 저장.
명령어
기본 실행문
# docker exec [Container Name] /usr/bin/mysqldump -u [UID] --password=[Password] [DB Name] > [Backup File Full Path]
docker exec con_mariadb /usr/bin/mysqldump -u root -password=system workspace_db > /usr/bin/backup/backup_20210112.sql
옵션
# 전체 DB Backup
docker exec [Container Name] /usr/bin/mysqldump -u [UID]
--password=[Password]
--all-databases > [Backup File Full Path]
# 특정 DB Backup
docker exec [Container Name] /usr/bin/mysqldump -u [UID]
--password=[Password] [DB Name] > [Backup File Full Path]
# DDL Backup
docker exec [Container Name] /usr/bin/mysqldump -u [UID]
--password=[Password]
--all-databases
--no-data > [Backup File Full Path]
# 특정 DB 프로시저 포함 Backup
docker exec [Container Name] /usr/bin/mysqldump -u [UID]
--password=[Password]
--routines [DB Name] > [Backup File Full Path]
# 특정 DB 프로시저만 Backup
docker exec [Container Name] /usr/bin/mysqldump -u [UID]
--password=[Password]
--routines
--triggers [DB Name] > [Backup File Full Path]
# 특정 Table Backup
docker exec [Container Name] /usr/bin/mysqldump -u [UID]
--password=[Password] [DB Name] [Table Name1] > [Backup File Full Path]
# 특정 Table Data만 Backup
docker exec [Container Name] /usr/bin/mysqldump -u [UID]
--password=[Password]
--no-create [DB Name] [Table Name1] > [Backup File Full Path]
반응형
'Product > Docker' 카테고리의 다른 글
[Docker] Container Root 계정으로 접속 (0) | 2022.01.12 |
---|---|
[Docker] Private Nuget : BaGet 서버 구축 (0) | 2021.07.21 |
[Docker] MariaDB 올리기 (0) | 2021.05.13 |
[Docker] Image / Container 관리 (Export, Import, Save, Load) (0) | 2021.01.07 |
[Docker] 실행중인 Container restart 옵션 추가 (0) | 2021.01.07 |