Sometime, we need to check the list of processes running inside database or check the status of query. Various database provides their own way to check it.

MySQL:
If you are on MySQL database then run the below sql to check the list of processes;

show processlist;
# to kill process
kill <process_id>

Postgres:
Inside the Postgres database, you can the same using the below SQL.

select * from pg_stat_activity;
# to kill process
SELECT * FROM pg_stat_activity WHERE state = 'active'; 
# Find the process you want to kill, then type:
SELECT pg_cancel_backend()