Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2013, 'Lost connection to MySQL server during query ([Errno 60] Operation timed out)' #1685

Open
Caprey opened this issue Jul 29, 2024 · 1 comment

Comments

@Caprey
Copy link

Caprey commented Jul 29, 2024

DATABASE_CONFIG

TORTOISE_ORM = {
    "connections": {
        "default": {
            "engine": "tortoise.backends.mysql", 
            "credentials": {
                "host": settings.mysql_host,    
                "port": settings.mysql_port,         
                "user": settings.mysql_user,         
                "password": settings.mysql_password,     
                "database": settings.mysql_database,
                "minsize": 1,           
                "maxsize": 5,           
                "charset": "utf8mb4",   
                "echo": True            
            }
        },
    },
    "apps": {
        "models": {
            "models": ["app.memoir.models", "app.diary.models", "app.chat.models", "aerich.models"],
            "default_connection": "default",
        }
    },
    "use_tz": False,
    "timezone": "Asia/Shanghai"
}
@Abdeldjalil-H
Copy link
Contributor

Abdeldjalil-H commented Jul 29, 2024

This is most likely related to your database server configuration not tortoise. Can you check the value of wait_timeout using

SHOW VARIABLES LIKE 'wait_timeout';

If you have long queries that take longer than this value then you have to set your timeout to a bigger value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants