뚜벅이 한걸음

#42000 MYSQL 부정확한 컬럼 정의 본문

오늘의 에러

#42000 MYSQL 부정확한 컬럼 정의

뚜벅뚜벅뚜벅이 2022. 7. 14. 23:00
반응형
 
create table image (
path varchar(100) not null Auto-increment,
fileName varchar(100) not null 
)

mysql에서 다음과 비슷한 형식으로 테이블을 만들려고 하는데 오류가 발생했다.

이상한점이 보이시나요..?

idex값 써야지 생각하고 auto-increment 를 varchar type에 주고있습니다.

하하

Auto-increment는 int 타입에만 줄 수있습니다.

다음과 같이 작성하면 정상적으로 생성됩니다.

 

create table image (
imidx int primary key Auto-increment,
path varchar(100) not null ,
fileName varchar(100) not null 
)​

 

반응형