Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- C
- error
- windows forms
- Python
- pip
- LIST
- VS Code
- label
- pandas
- 핑거스타일
- ubuntu
- Linux
- 컨테이너
- JSON
- 오류
- SSH
- paramiko
- 기타 연주
- mysql
- YOLO
- Selenium
- Visual Studio
- pytorch
- C#
- 프로그래머스
- Docker
- OpenCV
- Numpy
- 채보
- C++
Archives
- Today
- Total
목록foreign key constraint (1)
기계는 거짓말하지 않는다
MySQL 외래키 제약조건 foreign key 수정, 삭제 오류
테이블 B 가 테이블 A 의 특정 컬럼을 외래키로 설정하고 참조하고 있다면 참조된 테이블 A 의 튜플을 update, delete 시 오류 메시지를 볼 수 있다. Error Code: 1451. Cannot delete or update a parent row: a foreign key constraint fails 강제로 테이블 삭제, 튜플 수정, 삭제 하고자 한다면 아래와 같이 입력하면 된다. SET foreign_key_checks = 0;# foreign key 제약조건 무시 # Action (delete ...) SET foreign_key_checks = 1;# 다시 복구 실수 방지를 위해 해야 할 작업이 끝나면 다시 원상복구 시키는 것이 좋다.
DB/MySQL
2020. 12. 20. 18:40