티스토리 뷰
반응형
dump 방법
기본적으로 function, procedure를 포함하여 dump를 하는 방법은 아래와 같은 명령을 사용한다.
mysqldump -u[id] -p[password] --routines [db_name] > [file_name.sql]
그 외의 추가 옵션은 다음 페이지를 참고한다.
https://dev.mysql.com/doc/refman/8.0/en/mysqldump.html
MySQL :: MySQL 8.0 Reference Manual :: 4.5.4 mysqldump — A Database Backup Program
4.5.4 mysqldump — A Database Backup Program The mysqldump client utility performs logical backups, producing a set of SQL statements that can be executed to reproduce the original database object definitions and table data. It dumps one or more MySQL datab
dev.mysql.com
복구 방법
mysql -u[id] -p[password] [db_name] < [file_name.sql]
위와 같이 복구를 할 때 function을 생성하며 다음과 같은 오류가 발생할 수 있다.
This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled (you *might* want to use the less safe log_bin_trust_function_creators variable)
이럴 때는 log_bin_trust_function_creators 값을 확인해보자.
SHOW GLOBAL VARIABLES log_bin_trust_function_creators;
위 명령의 결과가 OFF인 경우 ON으로 설정한다.
SET GLOBAL log_bin_trust_function_creators = 1;
반응형
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- 개발 생산성
- Solutions Architect
- vscode
- github
- 자격증
- 챗GPT
- jekyll
- VS Code
- Python
- 1on1 meeting
- React
- docker
- Cloud
- Blog
- Java
- spring
- node설치
- Linux
- naver
- AZURE
- MS Ignite 2019
- 이슈 트래킹
- 랭체인
- langchain
- github blog
- maven
- AWS
- Git
- VIM
- ncp
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | |||
| 5 | 6 | 7 | 8 | 9 | 10 | 11 |
| 12 | 13 | 14 | 15 | 16 | 17 | 18 |
| 19 | 20 | 21 | 22 | 23 | 24 | 25 |
| 26 | 27 | 28 | 29 | 30 | 31 |
글 보관함
