Title: persistent database connections
Last modified: August 19, 2016

---

# persistent database connections

 *  [noname1](https://wordpress.org/support/users/greyisgood/)
 * (@greyisgood)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/persistent-database-connections/)
 * 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?

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [Samuel B](https://wordpress.org/support/users/samboll/)
 * (@samboll)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/persistent-database-connections/#post-1237539)
 * try adding this to `wp-config.php`
 * `define('USE_PCONNECT', 'false');`
 *  [MichaelH](https://wordpress.org/support/users/michaelh/)
 * (@michaelh)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/persistent-database-connections/#post-1237541)
 * Is that right Sam? I don’t find USE_PCONNECT in the core files…
 *  [Samuel B](https://wordpress.org/support/users/samboll/)
 * (@samboll)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/persistent-database-connections/#post-1237549)
 * 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 :>)
 *  [zahidraf](https://wordpress.org/support/users/zahidraf/)
 * (@zahidraf)
 * [16 years, 3 months ago](https://wordpress.org/support/topic/persistent-database-connections/#post-1237688)
 * I am running **zahipedia.com**
    Web site and getting this issue. site is temporally
   down
 * I called to hosting and they said all open connection has been used in the sites.
   when I checked and find the WordPress is using mysql_connect
 * should I use mysql_pconnect to avoid this issue
 * Any suggest
 * Thanks in advance

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘persistent database connections’ is closed to new replies.

## Tags

 * [database](https://wordpress.org/support/topic-tag/database/)
 * [mysql_connect](https://wordpress.org/support/topic-tag/mysql_connect/)
 * [wp-db](https://wordpress.org/support/topic-tag/wp-db/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 4 participants
 * Last reply from: [zahidraf](https://wordpress.org/support/users/zahidraf/)
 * Last activity: [16 years, 3 months ago](https://wordpress.org/support/topic/persistent-database-connections/#post-1237688)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
