Aborted connection to db: '...' user: '...' host: '...' (Got an error reading communication packets) #990
-
Hello, The minimal code looks like
This code is basically the same as this one here: https://aiomysql.readthedocs.io/en/stable/connection.html
However, I get the correct result, but anyway. There shouldn't be an error message for each query. Has anyone an idea what happened here? UPDATE: it works if I switch mariadb docker container to mysql, but anyway, is there a simple explanation? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
aiomysql simply closes the tcp connection without sending COM_QUIT packet when |
Beta Was this translation helpful? Give feedback.
aiomysql simply closes the tcp connection without sending COM_QUIT packet when
conn.close()
is called.You can use
await conn.ensure_closed()
to avoid error messages.ensure_closed()
can send COM_QUIT and then close the connection safely.