How to set connection timeout in SQLAlchemy

后端 未结 7 780
暗喜
暗喜 2020-12-14 16:00

I\'m trying to figure out how to set the connection timeout in create_engine(), so far I\'ve tried:

create_engine(url, timeout=10)
相关标签:
7条回答
  • 2020-12-14 16:37

    In response to comment below by @nivhanin which asks "What is the default value for the connect_timeout variable (in general and specific to MySQL database?"? (I don't have enough reputation to leave comments).

    Default for connect_timeout for Mysql5.7 is 10 seconds

    Also maybe relevant:

    • wait_timeout -- default value of 28800 seconds (8 hours)
    • interactive_timeout -- default value of 28800 seconds (8 hours)
    0 讨论(0)
提交回复
热议问题