Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.Original topic: 审计相关:tidb哪个表或者监控页面记录了user最后登陆时间

As mentioned, where is the user’s last login time and the last password change time recorded?
Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.Original topic: 审计相关:tidb哪个表或者监控页面记录了user最后登陆时间
As mentioned, where is the user’s last login time and the last password change time recorded?
Which version of MySQL and what is the table structure like?
user_logins, the specific version is related to the underlying MySQL version.
In TiDB 7.5, you can still check the last password change time using the query above, but I couldn’t find the last login time.
You can check the log page, this might be able to filter it out.
TiDB doesn’t have this feature for now, but there might be a workaround. You can enable the audit plugin and analyze the audit logs. Alternatively, using middleware like TiDB Proxy should record the user’s connection and disconnection times.
mysql.user has a record of the last modification time, but there is no record of the last login time.
What the heck, isn’t this the password change time? It has nothing to do with whether the user logs in or not.
The community edition cannot be queried directly, but you can enable logging and then query. The enterprise edition should be able to.