티스토리 뷰

카테고리 없음

BLOB 크기 PacketTooBigException

뽀로로친구에디 2018. 11. 6. 16:03

BLOB 용량 사이즈 바꾸기 


TINYBLOB

A binary large object column with a maximum length of 255 (2^8 - 1) characters.

BLOB

A binary large object column with a maximum length of 65535 (2^16 - 1) characters.

MEDIUMBLOB

A binary large object column with a maximum length of 16777215 (2^24 - 1) characters.

LONGBLOB

A binary large object column with a maximum length of 4294967295 (2^32 - 1) characters.


그런데 내가 사용하는 Mysql 5.1.32 버전은 기본 max_allowed_packet이 1048576(1MB)로 제한되어 있어서 아래와 같은 메시지가 나왔다.


com.mysql.jdbc.PacketTooBigException: Packet for query is too large (2919792 > 1048576). You can change this value on the server by setting the max_allowed_packet' variable.


결국은 Mysql을 조정하라는 내용이다. 

max_allowed_packet 을 변경하면 된다.


두가지 방법이 있는데 mysql에 접속해서 해당 변수 내용을 변경하는 방법과
my.cnf 파일을 수정해주는 방법이 있다.

1. mysql접속하여 변경
mysql> SET GLOBAL max_allowed_packet=8*1024*1024;
=> 8MB로 변경

2. my.cnf 변경
set-variable=max_allowed_packet=20M



댓글
최근에 달린 댓글
글 보관함
«   2025/02   »
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28
Total
Today
Yesterday
    뽀로로친구에디
    최근에 올라온 글