AWS RDS hotbackup(mysqldump)안 될 때!!

Kay·2020년 4월 27일
1

Local DB와 RDS를 오가며 작업하다보면 RDS를 hotbackup 떠야하는 순간이 온다..

아래 명령어를 입력해보면..
$ mysqldump -h "RDS Host 주소" -u root -p "DB 이름" > "원하는 파일이름".sql

이렇게나 길고 긴 경고 문구를 만나는 사람 나뿐인가 hoxy~?

[1] Warning: A partial dump from a server that has GTIDs will by default include the GTIDs of all transactions, even those that changed suppressed parts of the database. If you don't want to restore GTIDs, pass --set-gtid-purged=OFF. To make a complete dump, pass --all-databases --triggers --routines --events.

[2] mysqldump: Couldn't execute 'SELECT COLUMN_NAME,                       JSON_EXTRACT(HISTOGRAM, '$."number-of-buckets-specified"')                FROM information_schema.COLUMN_STATISTICS                WHERE SCHEMA_NAME = 'bf_test' AND TABLE_NAME = 'cases';': Unknown table 'COLUMN_STATISTICS' in information_schema (1109)

그럼에도 불구하고 "원하는 파일 이름".sql 파일이 생기기는 하지만, 열어보면 해당 스키마의 모든 테이블이 아니라 딸랑 하나만 들어있는 것을 확인할 수 있다.

위의 경고문구는 크게 두 파트로 나눠지는데,

[1] --set-gtid-purged=OFF 옵션을 추가하여 해결 가능
[2] --column-statistics=0 옵션을 추가하여 해결 가능

참고 :
https://qastack.kr/server/912162/mysqldump-throws-unknown-table-column-statistics-in-information-schema-1109

위의 두 옵션을 추가하여 mysqldump를 실행하면 에러 없이 hotbackup이 잘 떠진다!!
$ mysqldump --set-gtid-purged=OFF --column-statistics=0 -h "RDS Host 주소" -u root -p "DB 이름" > "원하는 파일이름".sql

#wecode #위코드 #코딩맛집6기화이팅

profile
new blog✨ https://kay-log.tistory.com/

0개의 댓글