Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

amitsolanki24_'s avatar

DB issue too many connection

Why I'm getting this error on production.

PDOException /artisan Error SQLSTATE[08004] [1040] Too many connections

I'm using laravel version 8.8.* https://jmp.sh/wJiP5Moo

0 likes
6 replies
Braunson's avatar

@amitsolanki24_ Regardless I would suggest checking into your MySQL config, something is eating up connections or the max connection rate is low. Work your way from the MySQL config (checking max connections) to how Laravel is using connections. Check the MySQL processes running when it's maxing out, see what queries are being run, etc.

amitsolanki24_'s avatar

@Braunson I have a doubt suppose if it would be the social networking site so what is the max connection I can set?

gych's avatar

@amitsolanki24_ if you use MySQL you can check current connections with this query, run this in your DB client

SHOW PROCESSLIST;

Please or to participate in this conversation.