greyisgood
Member
Posted 2 years 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?
try adding this to wp-config.php
define('USE_PCONNECT', 'false');
Is that right Sam? I don't find USE_PCONNECT in the core files...
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
Member
Posted 1 year ago #
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