I am looking for a way to track when users login and exit the database?
is there such function built in to track and trace this ?
I don’t see any timestamp in mysql.user table and information_schema statistics table is empty
Hi thanks for your question. Here’s a blog post that covers that topic (though not with positive news): [URL=“Auditing login attempts in MySQL”]https://www.percona.com/blog/2012/12...mpts-in-mysql/[/URL] - information_schema gets cleared down after a mysqld restart.
An alternative might be Percona’s audit log plugin [URL=“Audit Log Plugin — Percona Server 8.0 Documentation”]https://www.percona.com/doc/percona-...og_plugin.html[/URL] or the MySQL Enterprise equivalent. This writes login and logout to log files.
Would that work for you?