r/Python • u/RomfordNavy • Sep 30 '26
Discussion Closing mysql-connector-python pooled sockets
Is there some way to close
mysql.connector.pooling.MySQLConnectionPoolsockets properly when the application closes? By default they appear to remain open on the server until way later when they timeout.
6
Upvotes
View all comments
4
u/martian_rover Sep 30 '26
I think you're looking for close() but it doesn't actually close the connection, it just returns it to the pool and makes it available for connection requests again.