Click here to Skip to main content
15,891,657 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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 .
Posted

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
 
Share this answer
 
Comments
thatraja 31-Jan-12 15:44pm    
I heard about these, nice things. 5!
Espen Harlinn 31-Jan-12 16:17pm    
Thank you, thatraja!
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
 
Share this answer
 
v2
Comments
Espen Harlinn 31-Jan-12 15:08pm    
For MySQL there are some options that can be explored, like working with the server logs.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900