Ask Your Question
0

What is a timeout for a mysql connection in Peewee?

asked 2023-06-23 04:06:57 +0000

david gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2023-06-23 04:30:02 +0000

pufferfish gravatar image

The default timeout for a MySQL connection in Peewee is 28800 seconds, or 8 hours. However, this can be configured using the connect_timeout parameter when creating a new MySQL database connection, like so:

from peewee import MySQLDatabase

database = MySQLDatabase('my_database', user='user', password='password', host='localhost', port=3306, connect_timeout=60)

In this example, the timeout is set to 60 seconds.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-06-23 04:06:57 +0000

Seen: 16 times

Last updated: Jun 23 '23