분명 제약키를 삭제하는
alter table products drop foreign key products_ibfk_1;
이 명령문을 썼는데,
ERROR 1091 (42000): Can't DROP 'products_ibfk_1'; check that column/key exists
이게 계속 삭제되지 않았다고 나를 괴롭혔다...
장장 1시간 동안 이 오류를 해결하느라 애먹었다.
급기야 관련된 컬럼을 삭제하려고 해도 계속 해당 오류가 나타났다.
검색 끝에 이 문제를 해결할 수 있었다.
오류가 나는 것을 column으로 추가하고
삭제하면 된다.
여기서 products는 테이블, barcode는 삭제하려고 했던 컬럼
->삭제는 잘 된다. 하지만 외래키를 추가하려고 할 때 다시 저 오류가 나타나고,
alter table products drop foreign key products_ibfk_1;
이 오류가 다시 나타난다............
그래서 검색해본 블로그 말대로
ERROR 3780 (HY000): Referencing column '000' and referenced column '000' in foreign key constraint '000' are incompatible.
mysql로 테이블 두개를 만들었고, 데이터를 넣다가 양쪽의 컬럼을 묶어야 할 필요성을 느껴서 foreign key를 잡아주려고 했다. 테이블 구조 : 1. 부모 테이블 2. 자식 테이블 여기서 나는 crawlingDB의 medi
kkangdda.tistory.com
이렇게 하니까 된..다..........
-> varchar로는 계속 오류가 난다.....
github.com/go-gitea/gitea/issues/3056
Migration Error 1091: Can't DROP 'index'; check that column/key exists · Issue #3056 · go-gitea/gitea
Gitea version (or commit ref): 1.3.0 Git version: Operating system: Ubuntu 16.06 Database (use [x]): PostgreSQL MySQL MSSQL SQLite Can you reproduce the bug at https://try.gitea.io: Yes (provide ex...
github.com
'mySQL' 카테고리의 다른 글
[Database, mySQL]주키수정/주키변경 (0) | 2020.12.05 |
---|---|
[mySQL]Auto_increment 초기화 (0) | 2020.11.30 |
[mySQL]컬럼 추가삭제, 외래키 지정/삭제, 제약조건확인 (0) | 2020.11.26 |
bitnami로 mySQL접속하기 (0) | 2020.11.14 |
bitnami 사용법 (0) | 2020.06.09 |