go to bug id or search bugs for
The following problem occurred on a machine using PHP 5.1.4
with PDO 1.0.3 and MySQL 5.0.22. The PHP version dropdown
menu in the bug report form does not have options for 5.1.3
While running a simple query that contained the MySQL CONCAT
() function in the SELECT clause the following error was
Database Connection Error: SQLSTATE  Too many
The server did not have too many connections at the time the
query was run. There were 13 MySQL processes running out of
a potential 100.
The query took the following form:
SELECT CONCAT(field1, '-', field2) AS field1_field2 FROM
If the new field name after the AS keyword is changed to
something else, like: field1field2 then the query works.
The initial query works if it's run in the mysql client with
the same permissions as the web application. The query also
works when using the built-in PHP MySQL or MySQLi extension
I was only able to produce this error on my linux machines.
I tried the same initial query, with the same AMP stack, on
a Mac OS X (10.4.7) machine and the query did not complain
of "Too Many Connections".
In the table I have set-up, field1_field2 corresponds to the
name of an index on the table. Since changing the name to
something that does not match table's index fixes the query,
perhaps PDO registers some sort of collision and
misinterprets this as a 'Too Many Connections' error.
Again, I want to stress that when the query is run there are
NOT too many connections to the server. Memory and disk
space usage is nominal as well.
Add a Patch
Add a Pull Request
Never mind. This was an error in my code. A database
connection call was being run in a loop and generating the
error. However, MySQL was not logging the multiple
At any rate, it is not a PDO or PHP bug.
Sorry for anyone's time this may have wasted.
SQL query generates Too Many Connections error
How solve this problem.Is there any php code to stop the connection in runntime.