MySQL: Persistent connections

Published by

Posted on May 10, 2009

You may encounter a max user connection error if your my.cnf file is set to a low number and you have mysql.allow_persistent = on within your php.ini file.

You have two ways to fix this .

1) use a mysql_close() statement within your code. this is not needed for non-persistent connection per the PHP manual
PHP Manual

2) disallow persistent connection by turning it off within the php.ini file.

Persistent connection keeps the last connection active with mysql which goes into sleep mode.

Other errors you may see
Too many connections