I am trying to populate a history table in my database whenever information_schema.PROCESSLIST gets updated. I tried:
CREATE TRIGGER populate_history
AFTER INSERT ON information_schema.PROCESSLIST
FOR EACH ROW
INSERT INTO myDatabase.history_changes (host, db, query)
VALUES (new.HOST, new.DB,new.INFO);
But I am getting
Access denied for user 'root'@'localhost' to database 'information_schema'
I have already looked into this answer but it wasn't of any help.
Can someone point me what I am doing wrong?
UPDATE : As suggested by @zozo, I am going to explain my end goal -
I want to log everything done MANUALLY by a user in the database. Our customers have access to our production database and sometimes they manually edit a row in some table which cause errors on the app. I know our main emphasis should be not allowing them the production db access, but somehow thats not possible currently and I need something to log what they do manually with the tables.
The architecture we use:
We are using AWS RDS MySQL instance. We are using PHP and nodejs to connect to it.(PHP majorly). The codebase is on a separate AWS instance.
The customers use phpMyAdmin to edit records