如何检查哪些MySQL-数据库仍在使用中? #打扫干净

How to check which MySQL-databases are still in use? #CleaningUp

我这边正在清理,老程序员没有清理他不用的数据库和用户。 虽然一些数据库仍在被外部站点使用(在其他 ftp-服务器上),但有些已经过时并且只会使系统混乱。

My question is: How can I figure out which databases (& users) are still in use by other websites? (without checking every website that has ever been created where ever this might be located)

我需要确保 MySQL 数据库(和用户)不再被任何站点主动使用,以便我可以安全地删除它以清理系统。

p.s.: 也可能是数据库仍在使用中,但根本不做任何插入或更新,而只是选择数据来加载网站.

p.p.s.: 我不能(临时)deactivate/remove数据库(&用户),因为这会导致客户损失收入、客户、搜索排名等等等等,最后将花费 us/me.

好吧,如果你想连选我想你的选项是一般查询日志 https://dev.mysql.com/doc/refman/5.7/en/query-log.html 启用它,解析它并使用它 dbs/tables