Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQLSTATE[08004] [1040] Too many connections

Tags:

php

pdo

I'm getting this error messages SQLSTATE[08004] [1040] Too many connections, I'm using pdo adapter. Do I need to close connection? And how I do that?

like image 956
gee Avatar asked Feb 09 '10 15:02

gee


People also ask

What does this mean sqlstate hy000 1040 Too many connections?

What this means in practical terms is that a MySQL instance has reached its maximum allowable limit for client connections. Until connections are closed, no new connection will be accepted by the server.

Could not connect to server error 1040 Too many connections?

This means that the maximum number of clients that may be connected to the server has been reached. Either the client will have to wait for another client to log off, or the administrator will have to increase the maximum number of connections allowed.


1 Answers

In your my.conf file (usually located in /etc) find the line that says:

[mysqld] 

And somewhere below that set

max_connections=500 

Or whatever numeric value you need.

More information here: MySQL 5.5 Reference Manual: Too many connections.

like image 163
Camden S. Avatar answered Sep 19 '22 20:09

Camden S.