max_allowed_packet && net_buffer_length

 

The maximum size of one packet or any generated/intermediate string, or any parameter sent by the mysql_stmt_send_long_data() C API function. The default is 4MB.

一个数据包或任何生成/中间字符串的最大大小,或mysql_stmt_send_long_data()C API函数发送的任何参数。默认值为4MB。 

The packet message buffer is initialized to net_buffer_length bytes, but can grow up to max_allowed_packet bytes when needed. This value by default is small, to catch large (possibly
incorrect) packets.

数据包消息缓冲区被初始化为net_buffer_length字节,但在需要时可以增长到max_allowed_packet字节。默认情况下,此值很小,用于捕获较大(可能不正确)的数据包。

You must increase this value if you are using large BLOB columns or long strings. It should be as
big as the largest BLOB you want to use. The protocol limit for max_allowed_packet is 1GB. The
value should be a multiple of 1024; nonmultiples are rounded down to the nearest multiple.

如果使用大BLOB列或长字符串,则必须增加此值。它应该与您要使用的最大BLOB一样大。max_allowed_packet受协议限制为最大1G。该值应为1024的倍数;非倍数向下舍入为最接近的倍数。

When you change the message buffer size by changing the value of the max_allowed_packet
variable, you should also change the buffer size on the client side if your client program permits
it. The default max_allowed_packet value built in to the client library is 1GB, but individual
client programs might override this. For example, mysql and mysqldump have defaults of
16MB and 24MB, respectively. They also enable you to change the client-side value by setting
max_allowed_packet on the command line or in an option file.

当您通过更改max_allowed_packet变量的值来更改消息缓冲区大小时,如果您的客户端程序允许,您还应该在客户端更改缓冲区大小。客户端库内置的默认最大允许数据包值为1GB,但个别客户端程序可能会覆盖该值。例如,mysql和mysqldump的默认值分别为16MB和24MB。它们还允许您通过在命令行或选项文件中设置max_allowed_packet来更改客户端值。

The session value of this variable is read only. The client can receive up to as many bytes as the
session value. However, the server will not send to the client more bytes than the current global
max_allowed_packet value. (The global value could be less than the session value if the global
value is changed after the client connects.)

此变量的会话值为只读。客户端最多可以接收会话值的字节数。但是,服务器向客户端发送的字节数不会超过当前全局最大允许值。(如果在客户端连接后更改全局值,则全局值可能小于会话值。)

net_buffer_length

 Each client thread is associated with a connection buffer and result buffer. Both begin with a size
given by net_buffer_length but are dynamically enlarged up to max_allowed_packet bytes
as needed. The result buffer shrinks to net_buffer_length after each SQL statement.

每个客户端线程都与连接缓冲区和结果缓冲区相关联。两者都以net_buffer_length给定的大小开始,但根据需要动态放大到max_allowed_packet字节数。结果缓冲区在每个SQL语句之后收缩为net_buffer_length。

This variable should not normally be changed, but if you have very little memory, you can set it to the expected length of statements sent by clients. If statements exceed this length, the connection buffer is automatically enlarged. The maximum value to which net_buffer_length can be set is 1MB.

此变量通常不应更改,但如果内存很少,可以将其设置为客户端发送的语句的预期长度。

如果语句超过此长度,连接缓冲区将自动扩大。net_buffer_length可设置的最大值为1MB。

The session value of this variable is read only

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值