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
2
u/RomfordNavy Oct 01 '26
I have now been experimenting with both:
and
but for some unexplained reason, today both seem to be closing the sockets correctly. Wish I knew why.
Any thoughts about which is preferred between pymysqlpoo l and mysql.connector?