I would like to view the following columns in the query output in RDS MySQL. Could you help me to write sql query against the right system tables to view all the sql queries (from one specific db or all db ) executed by one specific database user or all users ?
The columns that I am trying to fetch are - database user name database name tablename, sql query id, sql query text, query start time query end time
For example, I executed select count(*) and then trying to see the list of comamnds that I had executed, so, I tried to query them using the system table "INFORMATION_SCHEMA.PROCESSLIST" but i coudldn't find the same. Please guide/correct me.
I connect the instance using "testuser" credentail and execute the following
create database testdb;
use testdb;
create table testdb.table01 as select * from testdb01.Persons;
select count(*) from testdb.table01;
SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER='testuser';
228336 testuser 10.xx.xxx.xxx:50881 Sleep 14
228337 testuser 10.xx.xxx.xxx:50882 testdb Query 0 executing SELECT * FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER='testuser'
LIMIT 0, 1000
Thank you,
Kind regards, sk