Hi, I have an app with 2 databases connected (mysql), the problem is, when the application is not used in some hours or days, the functions that show the second database (using a grid) run in connection error against the mysql server (
pymysql.err.OperationalError: (2006, "MySQL server has gone away (ConnectionResetError(104, 'Connection reset by peer'))"). The rest of the functions that use the main database work properly. The issue is only for the second db and it happened after hours of no use.
Trying to spot the issue on google, I found a similar error when using sqlalchemy, and the fix is setting an option to "true", i now is totally different but maybe there is a pydal option that i need to set.
Ex:
SQLALCHEMY_ENGINE_OPTIONS = {
"pool_pre_ping": True,
"pool_recycle": 300,
}
This is my settings:
DB_URI = "mysql://easyxxxt:xxxx@localhost/db_one"
DB_POOL_SIZE = 1
DB_MIGRATE = True
DB_FAKE_MIGRATE = False # maybe?
DB_URI2 = "mysql://easyxxxt:xxxx@localhost/db_two"
DB_POOL_SIZE2 = 1
DB_MIGRATE2 = True
DB_FAKE_MIGRATE2 = False # maybe?
Cheers.
Chris.