Forums

persistent database connections (4 posts)

  1. greyisgood
    Member
    Posted 1 month ago #

    I have several installs of various WP verions on a web server connecting to MySQL on a different host. These installs are maintaining persistent database connections. This is a problem as the DNS can change on the MySQL server and these installs keep the old.

    The file wp-db.php doesn't have the call mysql_pconnect, but have the normal mysql_connect

    We have a number of installs with the same host for both web and DB (same MySQL as above) and they don't have the same issue.

    Any suggestions on cause/solution?

  2. samboll
    moderator
    Posted 1 month ago #

    try adding this to wp-config.php

    define('USE_PCONNECT', 'false');

  3. MichaelH
    moderator
    Posted 1 month ago #

    Is that right Sam? I don't find USE_PCONNECT in the core files...

  4. samboll
    moderator
    Posted 1 month ago #

    it does look like it's a relic

    but should work if you add this to wp-db.php

    if (USE_PCONNECT == 'false') {
     $link = mysql_pconnect($server, $username, $password);
     } else {
     $link = mysql_connect($server, $username, $password);
     }

    or maybe I'm in over my head :>)

Reply

You must log in to post.

About this Topic