Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
要列出活动连接,我们这样做:
show processlist;
如何列出旧的关闭连接?
简单的答案是 MySQL 没有提供任何东西来列出旧连接。但是您可以捕获在 Web 前端和数据库之间流动的数据:
tcpdump -i eth0 -s 0 -w /tmp/mysql.cap tcp port 3306
运行你的 PHP,让它失败,停止捕获并使用 Wireshark 来查看到底发生了什么。
我可以从serverfault获得这个不错的答案。