【问题标题】:How to close mysql connection automatically after specified time in python?如何在python中指定时间后自动关闭mysql连接?
【发布时间】:2015-11-29 06:08:26
【问题描述】:

如果查询时间超过 50 秒,我想在 50 秒后自动关闭 MySQL 数据库连接?在进行连接或任何其他解决方案时,python 中是否有任何选项?

【问题讨论】:

标签: python mysql database


【解决方案1】:

Reference site for python database connection

查看此站点中的 Connection,他们可能会解释 querytimeout,您可以传递一个 integer

【讨论】:

  • 这不适用于 mysql 并且显示无效变量
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-12-06
  • 2013-05-23
  • 1970-01-01
相关资源
最近更新 更多