"Too many connection errors" Restart MySQL

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

"Too many connection errors"  : The max_connection_errors in MySQL
admin is set quite hish. Therefore we do not know where this error
comes from.

With this script :
  ps -ef | grep mysql | grep mysqld | grep -v grep > mysqlstatus
         if [ -s mysqlstatus ]; then
           echo "MySQL: OK"
             echo "MySQL: NO"
             /etc/rc.d/init.d/mysqld restart
        rm mysqlstatus

We restart MySQL when it is down. We need to enrich it in order to
have MySQL restarted when "Too many connection errors". We do not know
if a test connection to the database to be the answer. Please (double
please) : might you add two or three lines in order to restart MySQL
when we have  "Too many connection errors". I thank you very much in

Sorry if I did not answer the message : but post an answer to Google
group, does not seem to work on my machin or account.


Re: "Too many connection errors" Restart MySQL

*** Henry wrote/escribió (23 Dec 2004 00:15:15 -0800):
Quoted text here. Click to load it

It probably comes from persistent connections (some apps like osCommerce
use them). Those connections are kept open even when no one is visiting the
site, possibly having one connection per Apache thread. I've disabled them
for PHP:

; Allow or prevent persistent links.
;mysql.allow_persistent = On

The default limit is 100 and you need to have a really successful site to
need 100 simultaneous connections. Disabling this option won't make apps
stop working.

-- Álvaro G. Vicario - Burgos, Spain
-- Thank you for not e-mailing me your questions

Re: "Too many connection errors" Restart MySQL

Henry wrote:

Quoted text here. Click to load it


Might be a good idea to make sure your scripts are closing the connection -
something like an include file, autoprepended vi php.ini:

function all_finished_so_close_db_connection()




Re: "Too many connection errors" Restart MySQL

On Thu, 23 Dec 2004 14:54:57 +0000, Colin McKinnon

Quoted text here. Click to load it

 Isn't that redundant? MySQL connections are automatically closed at end of
script already. mysql_close() is only there so you can release resources early
if you know you're not going to need it for the rest of the script.

<http://www.andyhsoftware.co.uk/space Space: disk usage analysis tool

Re: "Too many connection errors" Restart MySQL

Quoted text here. Click to load it

My server logs a warning every time a script exits without using

041223  8:52:07 [Warning] Aborted connection 411965 to db: 'mail' user: 'smail'
host: `mysql.domain.com' (Got an error reading communication packets)

(In this case, it's not a script, it's a program, and it doesn't seem to
have hooks to close the connection properly.)

                    Gordon L. Burditt

Site Timeline