我需要监视数据库中的mysql用户 [英] i need to monitor mysql users in my databases

查看:132
本文介绍了我需要监视数据库中的mysql用户的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

那里


我对Mysql数据库非常熟悉,我一直在一个IT领域工作,处理运行sql脚本来查询不同报告的数据库.

我的问题很简单,我想知道是否有办法找出不同用户在数据库中运行的所有记录或脚本.因为是管理它的人,所以我想知道是否有一个表可以保存或记录不同用户使用的所有信息或脚本.这将有助于我进行良好的管理,并了解每个用户在一天之内的操作.


预先非常感谢您的帮助.

Hi There


Am very familia with Mysql Database , and i have been working in a IT Domain dealing with Databases running sql scripts to query different reports .

My question is very simple , i would like to know if there is a way to find out all the records or the script run in my database by different users. since am the one who administrate it , i would like to know if there is a table that holds or records all the information or script used by different users. this will help me to administrates well and know what each user did within a period of a day .


Thanks very much in advance for your help .

推荐答案

看看:

http://dev.mysql.com/doc/refman/5.6/en/account-activity-auditing.html [ ^ ]

http://fromdual.com/mysql-logon-and-logoff-trigger-for-auditing [ ^ ]

对于常规审核,您可以尝试使用日志:
http://dev.mysql.com/doc/refman/5.6/en/server- logs.html [^ ]-虽然我还没有尝试过,但是看起来很有希望.

MS SQL Server已更多功能已完成 [
Have a look at:

http://dev.mysql.com/doc/refman/5.6/en/account-activity-auditing.html[^]

http://fromdual.com/mysql-logon-and-logoff-trigger-for-auditing[^]

For general auditing you can try working with the logs:
http://dev.mysql.com/doc/refman/5.6/en/server-logs.html[^] - While I haven''t tried this, it looks promising.

MS SQL Server is more feature complete[^] when it comes to auditing.

Best regards
Espen Harlinn


我不认为基于客户端-服务器模型的MySQL或其他数据库管理系统旨在监视用户. (有人可以证明我错了,请发表评论.)

因此,解决方案将是在某些中间中监视用户的活动.但是在这种情况下,所有数据库连接都应完全关闭,以防止来自外部的任何访问,并且只能由该中间层(您可以在与数据库主机相同的主机或相同的本地网络上运行该中间层)进行访问.对数据库的所有请求应仅发送到中间层,并且该层应将所有请求和查询结果中继到数据库管理系统或从数据库管理系统转发.

您仍然可以使用3层模型;在这种情况下,您的监视功能可以添加到逻辑层.

您可以选择该层的任何通信模型以在网络上工作.我建议使用WCF服务. WCF可以由层服务自行托管.如果您不使用.NET或不是所有的客户端都是.NET应用程序,则它可能是Web服务.

请参阅:
http://en.wikipedia.org/wiki/Multi-tier_architecture [ http://en.wikipedia.org/wiki/Windows_Communication_Foundation [ http://msdn.microsoft.com/en-us/library/ms733128.aspx [ ^ ],
http://en.wikipedia.org/wiki/Web_service [
I don''t think MySQL or other database management systems based on client-server model is designed to monitor the users. (Is someone can prove me wrong, please post a comment.)

So, the solution would be monitoring the users'' activity in some intermediate tier. But in this case, all database connectivity should be completely closed for any access from outside and made only accessible by this intermediate tier (which you can run on the same host or same local network as the database host). All requests to the database should be sent only to the intermediate tier, and this tier should relay all requests and query results to/from database management system.

You can still use a 3-tier model; in this case your monitoring functionality could be added to a logic tier.

You can choose any communication model for this tier to work on the network; I would suggest to prefer a WCF service. WCF could be self-hosted by the tier service. If you are not using .NET or not all of your clients are .NET application, it could be a Web service.

Please see:
http://en.wikipedia.org/wiki/Multi-tier_architecture[^],
http://en.wikipedia.org/wiki/Windows_Communication_Foundation[^],
http://msdn.microsoft.com/en-us/library/ms733128.aspx[^],
http://en.wikipedia.org/wiki/Web_service[^].

—SA


这篇关于我需要监视数据库中的mysql用户的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆