当前位置:网站首页>MySQL exception: com mysql. jdbc. PacketTooBigException: Packet for query is too large(4223215 > 4194304)
MySQL exception: com mysql. jdbc. PacketTooBigException: Packet for query is too large(4223215 > 4194304)
2022-06-13 00:54:00 【zly3500】
as a result of MySQL Of max_allowed_packet The setting is too small ,max_allowed_packet If not set , The default values are in different MySQL Different versions , Some versions default to 1M, Some versions default to 4M.
mysql According to the configuration file, it will limit server Accepted packet size . Sometimes big inserts and updates are max_allowed_packet Parameters limit , Result in failure .
1、 View the current configuration :
Get into MYSQL
command : mysql -uroot -p
Enter password:mysql password
( Or other database connection tools , Query or command-line interface can also )
View the current configuration :
Input show variables like '%max_allowed_packet%';
mysql> show variables like '%max_allowed_pack%';
2、1 Modify the configuration , What I set up here is 20M
stay MYSQL Internal input set global max_allowed_packet = 2*1024*1024*10;(20M)
mysql> set global max_allowed_packet = 10 * 1024 * 1024;
2、2( Profile persistent modification ):
vim /etc/my.cnf
[mysqld]
max_allowed_packet = 100M
Be careful : After modifying the configuration file , Need to restart mysql Service to take effect
1、 Use service start-up :service mysqld restart
2、 Use mysqld The script to start :/etc/inint.d/mysqld restart
start-up :# service mysqld start
stop it :# service mysqld stop
restart :# service mysqld restart
边栏推荐
- Kotlin coroutine withcontext switch thread
- What is pytorch? Explain the basic concepts of pytorch
- Blinker FAQs
- . The way to prove the effect of throwing exceptions on performance in. Net core
- [JS component] previous queue prompt
- Notes: the 11th and 12th generation mobile versions of Intel support the native thunderbolt4 interface, but the desktop version does not
- STM32 USB Basics
- With a market value of more than trillion yuan and a sales volume of more than 100000 yuan for three consecutive months, will BYD become the strongest domestic brand?
- Et5.0 simply transform referencecollectorieditor
- Kali system -- host, dig, dnsenum, imtry for DNS collection and analysis
猜你喜欢
随机推荐
草在结种子了
Get preview of precast body
Arduino control soil moisture sensor
Tree - delete all leaf nodes
Comparison of disk partition modes (MBR and GPT)
为什么磁盘分区的时候,第一个分区前面总有一段空间(63或者2048个扇区)
How many steps are appropriate for each cycle of deep learning?
[JS component] floating text
Can GPU acceleration pytorch work?
Notes: the 11th and 12th generation mobile versions of Intel support the native thunderbolt4 interface, but the desktop version does not
[server data recovery] successful cases of data loss recovery during data migration between storage servers
Stack overflow learning summary
Summary of openstack installation problems
Bubble sort - alternate sort at both ends
Arduino interrupt
[JS component] dazzle radio box and multi box
Today's sleep quality record 74 points
Zhouchuankai, Bank of Tianjin: from 0 to 1, my experience in implementing distributed databases
Assembly language learning
What is pytorch? Explain the basic concepts of pytorch