[SQL Error] you have an error in your SQL Syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' order

myeonji·2022년 1월 24일
0

Error

목록 보기
1/8

[SQL Error] you have an error in your SQL Syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ' order

Order Entity를 만들어서 @Entity 어노테이션 달고 실행 했더니 에러가 떴다. 이는 order 라는 테이블 명을 사용할 수 없다는 에러이다. order 라는 테이블 명은 sql 예약어 이기 때문에 사용할 수 없다. 따라서 @Table(name = "orders") 라는 어노테이션으로 테이블 명을 order에서 orders로 바꿔주어 에러를 해결했다.

Mysql 예약어 종류

ACCESSIBLEADDALL
ALTERANALYZEAND
ASASCASENSITIVE
BEFOREBETWEENBIGINT
BINARYBLOBBOTH
BYCALLCASCADE
CASECHANGECHAR
CHARACTERCHECKCOLLATE
COLUMNCONDITIONCONSTRAINT
CONTINUECONVERTCREATE
CROSSCURRENT_DATECURRENT_TIME
CURRENT_TIMESTAMPCURRENT_USERCURSOR
DATABASEDATABASESDAY_HOUR
DAY_MICROSECONDDAY_MINUTEDAY_SECOND
DECDECIMALDECLARE
DEFAULTDELAYEDDELETE
DESCDESCRIBEDETERMINISTIC
DISTINCTDISTINCTROWDIV
DOUBLEDROPDUAL
EACHELSEELSEIF
ENCLOSEDESCAPEDEXISTS
EXITEXPLAINFALSE
FETCHFLOATFLOAT4
FLOAT8FORFORCE
FOREIGNFROMFULLTEXT
GRANTGROUPHAVING
HIGH_PRIORITYHOUR_MICROSECONDHOUR_MINUTE
HOUR_SECONDIFIGNORE
ININDEXINFILE
INNERINOUTINSENSITIVE
INSERTINTINT1
INT2INT3INT4
INT8INTEGERINTERVAL
INTOISITERATE
JOINKEYKEYS
KILLLEADINGLEAVE
LEFTLIKELIMIT
LINEARLINESLOAD
LOCALTIMELOCALTIMESTAMPLOCK
LONGLONGBLOBLONGTEXT
LOOPLOW_PRIORITYMASTER_SSL_VERIFY_SERVER_CERT
MATCHMAXVALUEMEDIUMBLOB
MEDIUMINTMEDIUMTEXTMIDDLEINT
MINUTE_MICROSECONDMINUTE_SECONDMOD
MODIFIESNATURALNOT
NO_WRITE_TO_BINLOGNULLNUMERIC
ONOPTIMIZEOPTION
OPTIONALLYORORDER
OUTOUTEROUTFILE
PRECISIONPRIMARYPROCEDURE
PURGERANGEREAD
READSREAD_WRITEREAL
REFERENCESREGEXPRELEASE
RENAMEREPEATREPLACE
REQUIRERESIGNALRESTRICT
RETURNREVOKERIGHT
RLIKESCHEMASCHEMAS
SECOND_MICROSECONDSELECTSENSITIVE
SEPARATORSETSHOW
SIGNALSMALLINTSPATIAL
SPECIFICSQLSQLEXCEPTION
SQLSTATESQLWARNINGSQL_BIG_RESULT
SQL_CALC_FOUND_ROWSSQL_SMALL_RESULTSSL
STARTINGSTRAIGHT_JOINTABLE
TERMINATEDTHENTINYBLOB
TINYINTTINYTEXTTO
TRAILINGTRIGGERTRUE
UNDOUNIONUNIQUE
UNLOCKUNSIGNEDUPDATE
USAGEUSEUSING
UTC_DATEUTC_TIMEUTC_TIMESTAMP
VALUESVARBINARYVARCHAR
VARCHARACTERVARYINGWHEN
WHEREWHILEWITH
WRITEXORYEAR_MONTH
ZEROFILL
profile
DBA, 경제 그리고 고냥이

0개의 댓글