1 | initial version |
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.