1

I need to find all the users when they last logged in in mysql. My goal is to cleanup users that are not used for months. Please help

Surya
  • 19
  • 1
  • 2

1 Answers1

0

mysql hasn't such a thing. You could force the users to change the password every 90 days and select the date, where the users didn't change their password.

By

SELECT User FROM mysql.user WHERE password_last_changed <  NOW() - INTERVAL  3 MONTH;

Everything else would require things like enable file logs see for more information

nbk
  • 8,191
  • 5
  • 13
  • 27