본문 바로가기 메뉴 바로가기

ABBO 기술 블로그

프로필사진
  • 글쓰기
  • 관리
  • 태그
  • 방명록
  • RSS

ABBO 기술 블로그

검색하기 폼
  • 분류 전체보기 (465)
    • AI Trend (2)
    • Git (12)
    • Server (242)
    • Client (69)
    • Apple (31)
    • Study (109)
  • 방명록

mysql error (1)
[1822] MYSQL 에러 추적 Failed to add the foreign key constraint

해당 에러는 FK 로 묶으려고 하는 테이블의 문제가 아닌 기존의 테이블의 Unique Key, Primary Key 가 설정되어 있지 않은 경우 발생하는 에러입니다. 예를 들어 다음과 같이 테이블이 2개가 존재한다고 가정해봅니다. create table A ( keycolumn1 bigint not null auto_increament, created_at datetime(6), primary key (keycolumn1) ) create table B ( keycolumn2 bigint not null auto_increment, foreign bigint, created_at datetime(6) ) alter table B add constraint fk_b_to_a foreign key (fore..

Server 2022. 4. 16. 18:34
이전 1 다음
이전 다음
공지사항

Blog is powered by Tistory / Designed by Tistory

티스토리툴바