`
arpenker
  • 浏览: 330804 次
  • 性别: Icon_minigender_1
  • 来自: 广州
社区版块
存档分类
最新评论

mysql超经典的8小时问题-wait_timeout

阅读更多

大量插入数据时报错:连接池异常。

2022-09-02 17:19:51 [ERROR] - The driver was unable to create a connection due to an inability to establish the client portion of a socket.

 

This is usually caused by a limit on the number of sockets imposed by the operating system. This limit is usually configurable. 

 

For Unix-based platforms, see the manual page for the 'ulimit' command. Kernel or system reconfiguration may also be required.

 

For Windows-based platforms, see Microsoft Knowledge Base Article 196271 (Q196271).

com.mysql.cj.jdbc.exceptions.CommunicationsException: The driver was unable to create a connection due to an inability to establish the client portion of a socket.

 

This is usually caused by a limit on the number of sockets imposed by the operating system. This limit is usually configurable. 

 

For Unix-based platforms, see the manual page for the 'ulimit' command. Kernel or system reconfiguration may also be required.

 

图1 超时报错

 

 

打开你的mysql或工具。运行命令行模式进入到 mysql命令行。

 mysql> show global variables like 'wait_timeout';

+---------------+-------+

| Variable_name | Value |

+---------------+-------+

| wait_timeout  | 28800 |

+---------------+-------+

1 row in set

 

mysql> set global wait_timeout=10;

Query OK, 0 rows affected

 

mysql> show global variables like 'wait_timeout';

+---------------+-------+

| Variable_name | Value |

+---------------+-------+

| wait_timeout  | 10    |

+---------------+-------+

1 row in set

 

mysql> 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics