max_allowed_packet 크기를 변경하는 방법
약보다 큰 할 때 MySQL BLOB라는 .Packets larger than max_allowed_packet are not allowed.
제가 시도한 것은 다음과 같습니다.
에서 MySQL을 했습니다.show variables like 'max_allowed_packet'을 받았습니다.
, 제가 해 보겠습니다.set global max_allowed_packet=33554432에 어 followed가 붙는다.show variables like 'max_allowed_packet' - 33554432입니다.
그러나 MySQL 서버를 재부팅하면 마법처럼 1048576으로 돌아갑니다.내가 여기서 뭘 잘못하고 있는 거지?
보너스 질문입니다. BLOB 필드를 압축할 수 있습니까?
의경의 my.ini ★★★★★★★★★★★★★★★★★」~/.my.cnf로 [mysqld] ★★★★★★★★★★★★★★★★★」[client]참조해 주세요.
max_allowed_packet=500M
MySQL 서비스를 재시작하면 완료됩니다.
상세한 것에 대하여는, 메뉴얼을 참조해 주세요.
max_allowed_packet 변수는 쿼리를 실행하여 글로벌하게 설정할 수 있습니다.
, 에서 ,my.inifile(드래곤112의 제안대로), 글로벌하게 설정해도, 서버가 재기동하면 값이 리셋 됩니다.
서버가 재기동할 때까지 모든 사용자에게 허용되는 최대 패킷을 1GB로 변경하려면 다음 절차를 따릅니다.
SET GLOBAL max_allowed_packet=1073741824;
부하 개발자가 이것을 수정하는 데 어려움을 겪고 있었기 때문에 Linux 사용자를 위해 더 자세히 설명해야겠다고 생각했습니다.
오픈 터미널
ssh root@YOURIP루트 패스워드를 입력하다
nano /etc/mysql/my.cnf되지 않을 해 주세요).vi후, installnano )를 반복합니다.install nano )붙다
max_allowed_packet=256M하다) (필요에 따라 크기를 조절하다)[MYSQLD]를 해서 그는 파일 맨 아래에 먼저 넣는 실수를 해서 작동하지 않았다.Control + (저장) 후 (삭제) 후 + (삭제 파일)
service mysqld restartphpmyadmin에서 변수 섹션의 변경을 확인할 수 있습니다.
PC에서 my.ini 파일을 찾는 방법을 알고 싶은 사람도 있을 것입니다.Windows 사용자에게 가장 좋은 방법은 다음과 같습니다.
- Win+R('실행' 단축키), services.msc를 입력하고 Enter 키를 누릅니다.
- 'MySQL56'과 같은 항목을 찾은 후 마우스 오른쪽 버튼을 클릭하고 속성을 선택합니다.
- "D:/Program Files/MySQL/MySQL Server 5.6/bin\mysqld" --defaults-file="D:\ProgramData\MySQL\MySQL Server 5.6\my.ini" MySQL56
http://bugs.mysql.com/bug.php?id=68516에서 이 답변을 받았습니다.
모든 지침에 따라 다음과 같이 작업하고 작업했습니다.
mysql> SELECT CONNECTION_ID();//This is my ID for this session.
+-----------------+
| CONNECTION_ID() |
+-----------------+
| 20 |
+-----------------+
1 row in set (0.00 sec)
mysql> select @max_allowed_packet //Mysql do not found @max_allowed_packet
+---------------------+
| @max_allowed_packet |
+---------------------+
| NULL |
+---------------------+
1 row in set (0.00 sec)
mysql> Select @@global.max_allowed_packet; //That is better... I have max_allowed_packet=32M inside my.ini
+-----------------------------+
| @@global.max_allowed_packet |
+-----------------------------+
| 33554432 |
+-----------------------------+
1 row in set (0.00 sec)
mysql> **SET GLOBAL max_allowed_packet=1073741824**; //Now I'm changing the value.
Query OK, 0 rows affected (0.00 sec)
mysql> select @max_allowed_packet; //Mysql not found @max_allowed_packet
+---------------------+
| @max_allowed_packet |
+---------------------+
| NULL |
+---------------------+
1 row in set (0.00 sec)
mysql> Select @@global.max_allowed_packet;//The new value. And I still have max_allowed_packet=32M inisde my.ini
+-----------------------------+
| @@global.max_allowed_packet |
+-----------------------------+
| 1073741824 |
+-----------------------------+
1 row in set (0.00 sec)
따라서 max_allowed_packet이 my.ini 외부에서 변경되었습니다.
세션을 종료하고 다시 확인합니다.
mysql> exit
Bye
C:\Windows\System32>mysql -uroot -pPassword
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 21
Server version: 5.6.26-log MySQL Community Server (GPL)
Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> SELECT CONNECTION_ID();//This is my ID for this session.
+-----------------+
| CONNECTION_ID() |
+-----------------+
| 21 |
+-----------------+
1 row in set (0.00 sec)
mysql> Select @@global.max_allowed_packet;//The new value still here and And I still have max_allowed_packet=32M inisde my.ini
+-----------------------------+
| @@global.max_allowed_packet |
+-----------------------------+
| 1073741824 |
+-----------------------------+
1 row in set (0.00 sec)
Now I will stop the server
2016-02-03 10:28:30 - Server is stopped
mysql> SELECT CONNECTION_ID();
ERROR 2013 (HY000): Lost connection to MySQL server during query
Now I will start the server
2016-02-03 10:31:54 - Server is running
C:\Windows\System32>mysql -uroot -pPassword
Warning: Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 9
Server version: 5.6.26-log MySQL Community Server (GPL)
Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> SELECT CONNECTION_ID();
+-----------------+
| CONNECTION_ID() |
+-----------------+
| 9 |
+-----------------+
1 row in set (0.00 sec)
mysql> Select @@global.max_allowed_packet;//The previous new value has gone. Now I see what I have inside my.ini again.
+-----------------------------+
| @@global.max_allowed_packet |
+-----------------------------+
| 33554432 |
+-----------------------------+
1 row in set (0.00 sec)
결론적으로 SET GLOBAL max_allowed_displays=set3741824 이후에는 앞서 설명한 바와 같이 서버가 재시작될 때까지 새로운 max_allowed_displays가 서버에 할당됩니다.
백업 실행 중 이 오류가 발생하면max_allowed_packet로 설정할 수 있습니다.my.cnf특히를 위해서mysqldump.
[mysqldump]
max_allowed_packet=512M
이 에러가 계속 발생하고 있습니다.mysqldump그리고 나는 이 세트를 가지고 있었기 때문에 이해하지 못했다.my.cnf아래쪽에[mysqld]부분.일단 내가 그걸 알아냈을 때[mysqldump]값을 설정하면 백업은 문제없이 완료됩니다.
wampmysql 서버를 실행하고 있는 사용자용
Wamp 트레이 아이콘 -> MySql -> my.ini
[wampmysqld]
port = 3306
socket = /tmp/mysql.sock
key_buffer_size = 16M
max_allowed_packet = 16M // --> changing this wont solve
sort_buffer_size = 512K
찾을 때까지 끝까지 아래로 스크롤합니다.
[mysqld]
port=3306
explicit_defaults_for_timestamp = TRUE
사이에 packet_size 행을 추가합니다.
[mysqld]
port=3306
max_allowed_packet = 16M
explicit_defaults_for_timestamp = TRUE
이 쿼리와 함께 작동하는지 확인합니다.
Select @@global.max_allowed_packet;
이 오류는 데이터에 설정 값보다 큰 값이 포함되어 있기 때문에 발생합니다.
그냥 적어주세요.max_allowed_packed=500M500*1024k를 계산해서 500M 대신 사용할 수도 있습니다.
이제 MySQL을 다시 시작합니다.
Amazon RDS 서비스에서 MySQL을 실행하는 모든 사용자의 경우 이 변경은 매개 변수 그룹을 통해 수행됩니다.새 PG를 작성하거나 기존 PG를 사용해야 합니다(기본값인 읽기 전용이 아님).
를 검색해 주세요.max_allowed_packetparameter 값을 변경하고 save를 클릭합니다.
MySQL 인스턴스로 돌아가서 새 PG를 만든 경우 해당 PG를 인스턴스에 연결해야 합니다(재기동이 필요할 수 있음).인스턴스에 이미 연결된 PG를 변경한 경우 변경 내용은 해당 PG가 연결된 모든 인스턴스에 재부팅하지 않고 적용됩니다.
많은 응답자들이 문제를 발견하고 이미 해결책을 제시했습니다.
툴의 Mysql Workbench 내에서 Glogal 변수 값을 변경하는 다른 솔루션을 제안하고 싶습니다.이는 물론 서버(또는 SSH 접속 경유)에서 로컬로 실행되는 Workbench를 사용하는 경우입니다.
인스턴스에 연결하고 메뉴로 이동하기만 하면 됩니다.
서버 -> 옵션파일 -> 네트워킹 -> max_allowed_packed
원하는 값을 설정한 후 MySql 서비스를 재시작해야 합니다.
MySql Workbench를 사용하여 허용된 최대 패킷 크기를 설정하고 서버를
재시작합니다.
의 경우 MYSQL 5.7의 max_allowed_packet최대 1G입니다. 4G로 설정할 경우 오류나 경고 없이 실패합니다.
데이터베이스에 빅사이즈 이미지나 데이터를 업로드 할 경우.을 '아까보다'로 됩니다.'BIG BLOB'.
global max_allowed_displays=set000000을 설정합니다.
언급URL : https://stackoverflow.com/questions/8062496/how-to-change-max-allowed-packet-size
'source' 카테고리의 다른 글
| 도우미 클래스와 유틸리티 클래스의 차이점은 무엇입니까? (0) | 2023.01.19 |
|---|---|
| 템플릿의 모델 인스턴스 필드 이름 및 값에 대해 반복 (0) | 2023.01.19 |
| JPA와 JDBC는 어떻게 다른가요? (0) | 2023.01.09 |
| 목록을 비우려면 어떻게 해야 하나요? (0) | 2023.01.09 |
| MySQL 5.1보다 느린 Mariadb 5.5 (0) | 2023.01.09 |
