Is there any we we can send alert/email if any query run longer than 5 Minutes?

how we can send email alert to user if any query run longer than N minutes? using cron job or using PMM tool??

Hello @Pavanmysql,
You will first need an SMTP server configured to handle the outbound email sending aspect. You can use a dummy gmail account or set up a simple SMTP daemon. After that, you can do this via a cron script that you will need to write. You can query performance_schema.processlist where time > 60 to return any queries running longer than 60s. Craft that result into an email and then send it.

2 Likes