Fai*_*nus 4 mysql linux mysqladministrator mysqladmin
在审计任务中,我将删除几个 mysql 用户。在删除之前我想检查一下,这些用户上次访问数据库服务器是什么时候。我想知道我们是否将这些信息存储在information_schema或mysql数据库中。如果不是,我们怎么能做到这一点?
小智 5
You can look in the general log for any unsuccessful connection attempts to MySQL however out-of-the-box, MySQL typically does not log successful DB connections. This could become a very, very large log and that activity may quickly overwhelm the I/O subsystem and cause problems for the DB.
You can setup this sort of logging however it will result in quite a LOT of data! have a look at this post over in the DBA Exchange: https://dba.stackexchange.com/questions/668/audit-logins-on-mysql-database
如果您使用的是您自己的数据库服务器,您应该能够做到这一点。如果你有一个 DBaaS 类型的东西,多租户数据库系统会在记录每个连接时死亡。这可能不可能?
您还可以从 Percona 博客中找到在 MySQL 中启用用户跟踪的一些步骤:https ://www.percona.com/blog/2012/12/28/auditing-login-attempts-in-mysql/
| 归档时间: |
|
| 查看次数: |
9873 次 |
| 最近记录: |