Is it possible to create a custom log table. For example I have 10 schema and I would like to log if somebody is using the "areva" schema. I want to know the last executed command time and the user. Is this possible in MySQL?
Tell me more
×
Database Administrators Stack Exchange is a question and answer site for
database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.
|
I experimented with trying to create a trigger for a system table (mysql.slow_log). It simply cannot be done. However, there is a rather unconventional method you may want to try: Step 01) Activate the slow_log with the output as a table and restart mysql
Step 02) Convert slow_log to MyISAM, copy it to areva_log, and index slow_log on db
Step 03) Create a Stored Procedure to Copy all Slow Log entries whose db is areva into mysql.areva_log
Step 04) Call the stored procedure every 15 minutes using a crontab or using a mysql event Step 05) Zap the slow log every week, month, or year:
Give it a Try !!! |
||||
|
|