Query and modify mysql max_allowed_packet

Source: Internet
Author: User
Tags mysql command line

Mysql max_allowed_packet queries and modifies the size of data packets received by the server according to the configuration file. Sometimes large inserts and updates are limited by the max_allowed_packet parameter, resulting in failure. View the current configuration of www.2cto.com show VARIABLES like '% max_allowed_packet %'. The result is: + updated + --------- + | Variable_name | Value | + -------------------- + --------- + | max_allowed_packet | 1048576 | + -------------------- + --------- + the preceding description shows that the current configuration is 1 M modification method 1) method 1: edit my. cnf to modify (my. in the [mysqld] section or mysql server configuration section. Max_allowed_packet = 20 m if my. cnf cannot be found, you can use mysql -- help | grep my. cnf to find the my. cnf file. 2) method 2 (compromise and tangle) go to mysql server and run set global max_allowed_packet = 2*1024*1024*10 in the mysql command line. Then close the mysql server link and enter. Show VARIABLES like '% max_allowed_packet %'; check whether max_allowed_packet is successfully edited.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.