Note

[MySQL] 테이블명 is not valid at this position expecting an identifier

by 달쿨

오류

프로젝트에서 character라는 table을 만들고자 했는데 오류가 발생했다.

 

https://dev.mysql.com/doc/refman/8.0/en/keywords.html

 

MySQL :: MySQL 8.0 Reference Manual :: 9.3 Keywords and Reserved Words

9.3 Keywords and Reserved Words Keywords are words that have significance in SQL. Certain keywords, such as SELECT, DELETE, or BIGINT, are reserved and require special treatment for use as identifiers such as table and column names. This may also be true

dev.mysql.com

찾아보니 MySQL의 키워드, 예약어는 테이블 및 열 이름과 같은 식별자로 사용하려면 특별한 처리가 필요하다는 것을 알 수 있었다.

character는 예약어

그리고 목록에 character가 있는 것을 확인...

예약어를 별도 처리 없이 그대로 쓰려고 했기 때문에 오류가 발생한 것이었다.

오류가 뜨지 않아요

`로 감싸서 해결!

블로그의 정보

note

달쿨

활동하기