MySQL Variables net_retry_count 数据库 参数变量解释及正确配置使用
本站中文解释
net_retry_count是MySQL中的一个参数变量,它决定了MySQL服务器要将一个网络包重发多少次(默认为9次),以便确定它是否已被传送成功。如果对对应的网络包进行了超过net_retry_count次重发,MySQL服务器会显示连接未建立的错误消息。
要设置net_retry_count,可以在MySQL服务器的my.cnf文件中执行如下操作:
[mysqld]
net_retry_count=
replace with an integer(不小于1),这就是你想要的net_retry_count的值了。通常,设置net_retry_count的值较大会增加网络连接的稳定性。完整的配置文件应配置如下:
[mysqld]
net_retry_count=20
官方英文解释
net_retry_count
| Command-Line Format | --net-retry-count=# |
|---|---|
| System Variable | net_retry_count |
| Scope | Global, Session |
| Dynamic | Yes |
| Type | Integer |
| Default Value | 10 |
| Minimum Value | 1 |
| Maximum Value (64-bit platforms) | 18446744073709551615 |
| Maximum Value (32-bit platforms) | 4294967295 |
If a read or write on a communication port is interrupted,
retry this many times before giving up. This value should be
set quite high on FreeBSD because internal interrupts are sent
to all threads.