에러:
Packet for query is too large (4,333,196 > 4,194,304). You can change this value on the server by setting the 'max_allowed_packet' variable.; nested exception is com.mysql.cj.jdbc.exceptions.PacketTooBigException: Packet for query is too large (4,333,196 > 4,194,304). You can change this value on the server by setting the 'max_allowed_packet' variable.
원인:
max_allowed_packet 값은 서버에 전달 또는 서버로부터 받게 되는 패킷의 최대 길이를 나타내는 시스템 변수이다.
현재 max_allowed_packet은 4,194,304Byte로 4MB로 설정되어 있다.
쿼리 길이가 packet에 설정한 최대 길이 제한보다 큰 경우 발생
해결:
max_allowed_packet 설정값 보기
SHOW VARIABLES LIKE 'max%';
max_allowed_packet 값을 8MB로 변경
SET GLOBAL max_allowed_packet = 8388608;
SET SESSION max_allowed_packet = 8388608;
'Database > MYSQL' 카테고리의 다른 글
PK 설계 (0) | 2023.09.01 |
---|---|
com.mysql.cj.jdbc.exceptions.MySQLTransactionRollbackException: Lock wait timeout exceeded; try restarting transaction (0) | 2022.11.07 |
"Host '' is blocked because of many connection errors; unblock with 'mysqladmin flush-hosts'" (0) | 2021.06.10 |
auto_increment 초기화 (0) | 2020.12.15 |