1 개요[ | ]
- MySQL auto_increment 환경변수
- AUTO_INCREMENT 컬럼값 지정규칙을 설정하는 환경변수
환경변수 | 설명 |
---|---|
auto_increment_offset | 초기값 |
auto_increment_increment | 증가값 |
2 적용 예시[ | ]
사례 | auto_increment_offset | auto_increment_increment | 컬럼값 예시 |
---|---|---|---|
사례1 | 1 | 10 | 1, 11, 21, 31, 41, 51, ... |
사례2 | 5 | 10 | 5, 15, 25, 35, 45, 55, ... |
사례3 | 3 | 3 | 3, 6, 9, 12, 15, 18, 21, ... |
3 확인[ | ]
Console
Copy
mysql> SHOW VARIABLES LIKE 'auto_inc%';
+--------------------------+-------+
| Variable_name | Value |
+--------------------------+-------+
| auto_increment_increment | 3 |
| auto_increment_offset | 3 |
+--------------------------+-------+
2 rows in set (0.00 sec)
4 같이 보기[ | ]
5 참고[ | ]
편집자 Jmnote Jmnote bot
로그인하시면 댓글을 쓸 수 있습니다.