|

[ErrorLog] SQLSyntaxErrorException: Can't DROP '------'; check that column/key exists

· 테크· Tips
ErrorLog

Machine translation — switch to KO for the original.

 

문제상황

Caused by: java.sql.SQLSyntaxErrorException: Can't DROP 'FKeto3m22w9lpxy6sb1er72ke96'; check that column/key exists

 

원인

삭제하고자 하는 컬럼에 fk가 설정되어 있어서 Drop 할 수 없는 경우에 해당한다.

 

해결방안

이 경우에는 먼저 fk를 삭제하고 나면 테이블을 삭제할 수 있다.

SHOW CREATE TABLE [TABLE Name]
ALTER TABLE [TABLE Name] DROP FOREIGN KEY [FK Symbol]

 

 

Comments

No comments yet. Be the first!

    318 posts in 테크

    15 / 318