Query OK, 0 rows affected, 1 warning (0.15 sec)

 

원인 ( 나의 경우)

https://bskwak.tistory.com/141?category=417447 에서 table를 작성하다가 생긴 에러

id INT(11) NOT NULL AUTO_INCREMENT

 

 

아래의 코드를 입력해 보면 경고 내용을 볼 수 있음

mysql> SHOW WARNINGS\G

 

위의 코드를 입력해본 결과

*************************** 1. row ***************************
  Level: Warning
   Code: 1681
Message: Integer display width is deprecated and will be removed in a future release.
1 row in set (0.00 sec)

 

에러가 뜨는 이유 

mysql 8.0.17 버전부터는 int datatype의 width를 설정하는 것을 더이상 지원하지 않고 향후 버전부터 제거될 기능 중 하나이기 때문에 발생하는 warning

 

해결방법

다음과 같은 코드를 입력하면 warning 해결

ALTER TABLE 테이블명 MODIFY COLUMN 컬럼명 데이터타입 조건;
-- ALTER TABLE topic MODIFY COLUMN id int NOT NULL AUTO_INCREMENT;

 

 

 

+ Recent posts