0

When I use pymysql and sqlalchemy.create_engine queries on my MySQL server.There are so many connections sleep.I want see the query language by process INFO so I can dispose or close the connect,but the processlist Info is Null.So How can I see detail query SQL of process.

My query process SQL

SELECT * FROM information_schema.processlist;

show enter image description here

Ramsey
  • 103
  • 7
  • If a connection is not executing a query (it is in sleep status), then what exactly do you expect to see in the info column? Also, what you are seeing there is probably a result of sqlalchemy's connection pooling: it creates and maintains multiple connections in the background and reuses them as it sees fit. If the number of open, yet idle connections are causing a problem, then I would suggest you to take a look at the connection pooling settings of sqlalchemy. Closing connections will probably not achieve the expected results. – Shadow Jun 07 '21 at 11:02
  • Oky.I understand.Thank you for your answer.So appreciate. – Ramsey Jun 08 '21 at 01:27

0 Answers0