0

I use MySQL. My database's name is "db", and I have a table called "Test".

I want recover the last update, so I used this query:

SELECT update_time
FROM information_schema.tables
WHERE table_schema='db'
AND table_name='Test';

But the result is NULL, so I converted my Table from InnoDB to MYISAM by using this query:

mysql> ALTER TABLE db.Test ENGINE=MYISAM;

and it worked.

But the problem is that when I want to convert the table PROCESSLIST from InnoDB to MYISAM I get this message:

mysql> use information_schema
Database changed
mysql> ALTER TABLE PROCESSLIST ENGINE=MYISAM;
ERROR 1044 (42000): Access denied for user 'root'@'localhost' to database 'information_schema'

So, is there another solution to know what is the last update for this table (PROCESSLIST)?

7
  • Why would you want to do that in the first place? That sounds like a really weird thing to do.
    – user1822
    Jun 11, 2013 at 22:09
  • @a_horse_with_no_name : I'm working on an application where I want to list the user logged on MySQL server, and when a user change his name my application must notify me and all this things should be in real time and I can't use trigger on system tables.
    – dardar.moh
    Jun 11, 2013 at 22:32
  • And why would that require to change the storage engine?
    – user1822
    Jun 11, 2013 at 22:33
  • Because when I use this query : SELECT update_time FROM information_schema.tables WHERE table_schema='information_schema' AND table_name='PROCESSLIST'; I get Update_time = NULL
    – dardar.moh
    Jun 11, 2013 at 22:39
  • Try to run your select in auto-commit mode, or end the transaction using a commit before running the select. Could be you are affected by MySQL's default isolation level REPEATABLE READ
    – user1822
    Jun 11, 2013 at 22:41

2 Answers 2

1

There is no way, because they are virtual tables. This is also the reason why you can't do anything with them, except for SELECT.

0
1

You can specify log_warnings=2 to get "Warnings related to‘Aborted connection information’ and replication will be logged to MySQL error log.

If you are using MySQL enterprise then "MySQL Audit" feature will be useful as it includes login and logoff attempts, attempts to access a database or a table, changes to database schema and much more for each and every MySQL user who accesses server.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.