728x90
CSV 파일을 MySQL 테이블로 import할 때 쿼리문이 아닌 workbench import wizard를 사용하면, boolean과 null 값을 처리하기가 어렵다.
null 값 처리
처음에는 null 값을 비워놓았는데 null로 값이 삽입되지 않고 에러가 났다.
그래서 null이라고 데이터를 입력한 후 import하니 성공적으로 DB에 삽입이 되었다.
boolean 값 처리
boolean값도 true, false로 삽입하였는데 잘 삽입되지 않아서 true는 1, false는 0으로 삽입하였다.
찾아보니 mysql에서는 boolean값을 0,1로 저장한다고 한다.
https://freegians.tistory.com/entry/MySQL-BOOLEAN-TYPE-use-tip
null = null
boolean = 1(true), 0(false)
728x90
'BackEnd > MySQL' 카테고리의 다른 글
[MySQL] csv 파일 Import, Export (MySQL Workbench) (1) | 2022.12.27 |
---|