Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This response is by design as a security measure, and is the result of reaching the <strong>max_connection_errors</strong> value for mysql. <a href="http://docs.oracle.com/cd/E17952_01/refman-5.0-en/communication-errors.html" rel="nofollow" title="Oracle's resource on this">Here's a link</a> Oracle provides which details most of the possible causes and solutions.</p> <p>Ultimately this means that there are so many successive connection failures that MySql stops responding to connection attempts. </p> <blockquote> <p>I use a cron, every 5 minutes which does a mysqladmin flush-hosts command.</p> </blockquote> <p>As you are reaching this limit so quickly, there are only a few likely culprits:</p> <ol> <li>Server is not correctly configured to use PDO.</li> <li>Running code includes very frequently creating new connections. <ul> <li>Results in quickly reaching the <strong>max_connections</strong> value, causing all subsequent connection attempts to fail... thus quickly reaching the <strong>max_connection_errors</strong> limit.</li> </ul></li> <li>Code is hitting an infinite loop, or cascading failure. <ul> <li>Obvious possibility, but must be mentioned. </li> <li>(i.e: pageA calls pageB and pageC, and pageC calls PageA)</li> </ul></li> <li>PDO is running fine, but some scripts take a long time to run, or never end. <ul> <li>Easiest way to catch this is turn down the <strong>max_execution_time</strong>.</li> </ul></li> </ol> <p>It is likely that whatever the case, this will be difficult to track down.</p> <ol> <li>Log a stack-trace of every mysql connection attempt to find what code is causing this.</li> <li>Check the mysql.err logfile</li> </ol> <p>While PDO does not require explicitly closing mysql connections, for cases like this there's a few practices that can prevent such ServerAdmin hunts.</p> <ul> <li>Always explicitly close mysql connections. <ul> <li>Build a <a href="http://edrackham.com/php/simple-php-mysql-class/" rel="nofollow" title="edrackham.com">simple Class</a> to handle all connections. Open, return array, close.</li> <li>The only time you need to keep a connection open is for cursors.</li> </ul></li> <li>Always define connection arguments in one and only one file included everywhere it is needed.</li> <li>Never increase <strong>max_execution_time</strong> unless you know you need it and you know the server can handle it. <strong>IF</strong> you need it, explicitly increase the value only for the script that needs it. <em>php.net/manual/en/function.set-time-limit.php</em> <ul> <li>If you increase <strong>max_execution_time</strong>, increase <strong>max_connections</strong>.</li> </ul></li> </ul> <p>dev.mysql.com/doc/refman/5.0/en/cursors.html</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload