테스트 사이트 - 개발 중인 베타 버전입니다

g5_member 테이블에 mb_nick_date 기본값 변경 쿼리인데요, 왜 안되는지 모르겠습니다. 채택완료

탭댄스의달인 4년 전 조회 2,064

g5_member 테이블에 mb_nick_date 기본값 변경 쿼리인데요, 왜 안되는지 모르겠습니다.

CURRENT_DATE 로 해도 안되요.

 

ALTER TABLE `g5_member` CHANGE `mb_nick_date` `mb_nick_date` DATE NOT NULL DEFAULT CURRENT_TIMESTAMP

 

#1064 - 'SQL 구문에 오류가 있습니다.' 에러 같읍니다. ('CURRENT_TIMESTAMP' 명령어 라인 1)

댓글을 작성하려면 로그인이 필요합니다.

답변 1개

채택된 답변
+20 포인트

https://dev.mysql.com/doc/refman/8.0/en/timestamp-initialization.html

For any https://dev.mysql.com/doc/refman/8.0/en/datetime.html" title="11.2.2 The DATE, DATETIME, and TIMESTAMP Types">TIMESTAMP or https://dev.mysql.com/doc/refman/8.0/en/datetime.html" title="11.2.2 The DATE, DATETIME, and TIMESTAMP Types">DATETIME column in a table, you can assign the current timestamp as the default value, the auto-update value, or both:

두 가지 데이터 타입만

CURRENT_TIMESTAMP

이것을 기본 값으로 쓰는 것이 가능합니다.

로그인 후 평가할 수 있습니다

댓글을 작성하려면 로그인이 필요합니다.

답변을 작성하려면 로그인이 필요합니다.

로그인