开发者社区 > 大数据与机器学习 > 实时计算 Flink > 正文

Flink cdc代码的方式结合mybatis读mysql运行一段时间报连接数据库超时的问题怎么解决

请教大佬们,Flink cdc代码的方式结合mybatis读mysql运行一段时间总是报连接数据库超时的问题: org.apache.ibatis.exceptions.PersistenceException:

Error querying database. Cause: com.mysql.cj.jdbc.exceptions.CommunicationsException: The last packet successfully received from the server was 94,894,842 milliseconds ago. The last packet sent successfully to the server was 94,894,842 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.

展开
收起
wenti 2023-02-06 15:21:34 498 0
1 条回答
写回答
取消 提交回答
  • GitHub https://github.com/co63oc/cloud

    提示增加选项autoReconnect=true

    2023-02-11 17:19:05
    赞同 展开评论 打赏

实时计算Flink版是阿里云提供的全托管Serverless Flink云服务,基于 Apache Flink 构建的企业级、高性能实时大数据处理系统。提供全托管版 Flink 集群和引擎,提高作业开发运维效率。

相关产品

  • 实时计算 Flink版
  • 热门讨论

    热门文章

    相关电子书

    更多
    2022 DTCC-阿里云一站式数据库上云最佳实践 立即下载
    云时代的数据库技术趋势 立即下载
    超大型金融机构国产数据库全面迁移成功实践 立即下载