How to know exactly who uses the MySQL database, find out the ip-addresses of all servers using it? Is it possible to get this information relative to some period in the past, for example, in the previous hour?

1 answer 1

Rename the database and see who will swear :)

In MySQL, as far as I know, there is no such logging. But you can find out who is connected to the database at the moment.

SELECT proc.`host` FROM information_schema.processlist proc WHERE proc.`db` = 'mydb' 

therefore, one of the solutions to the problem is to periodically perform this query with some sheduler (including the built-in one) and add the results to the log table.

Negative approach - you can skip short-lived connections.