Justtechjobs.com Find a programming school near you






Online Campus Both


php3-list | 199901

[PHP3] mysql: Persisant Connection problem: MySQL-PHP3-Apache From: Michael Widenius (monty <email protected>)
Date: 01/31/99

>>>>> "gmkelly" == gmkelly <gmkelly <email protected>> writes:

gmkelly> Hi All,
gmkelly> I have MySQL-2.05, PHP-3.0.6, Apache-1.3.4 on a RedHat 5.2 Linux
gmkelly> system running kernel release 2.2.0 on a dual PPro SMP System (128Mb).

gmkelly> In writing my php web pages I have noticed that the mysql_pconnect
gmkelly> will at times disappear, and then a "automatic" retry makes a pconnect but
gmkelly> defaults to my login name @ localhost. Now, I have set up a number of
gmkelly> MySQL user access accounts, and of course while I can tolerate the
gmkelly> pconnect invoking my username <email protected> and not the MySQL username
gmkelly> I originally login as, this will create big problems once I move out of the
gmkelly> "development" phase, onto real live testing on the net.

gmkelly> I have tried, and do pass all variables across my exclusively php pages,
gmkelly> (ie: $user, $password, $host, ..... etc.) but this doesn't help in making the
gmkelly> pconnect call re-pconnect with the original Host,Username,Password
gmkelly> request.

gmkelly> eg: I login in with mysql_pconnect($host,$user,$password) were
gmkelly> $host = "bushrock"; (/etc/hosts develops the FQDN from this alias)
gmkelly> $user = "gmkelly"; and $password = "helpme"; pconnection is made
gmkelly> OK, and I can do correct MySQL transfers. After about three php3
gmkelly> invoked screens later, I lose the pconnection, and it makes another
gmkelly> successfully but defaults with my login-name <email protected>

gmkelly> So is there a way to set the default $host, $user, $password in a
gmkelly> re-connecting pconnect ?

Hi!

This depends on how php does reconnect. The automatic reconnect
the MySQL library uses reconnects with the original user and password,
which makes me believe this is a php problem.

I verified this by doing:

'mysqladmin -u some_user -i1 ping' in one window and
'mysqladmin -i1 proc' in another window.

In a third window I did 'mysqladmin kill "threadid of ping process"'

mysqladmin nicely reconnected as 'some_user'.

Can you do some similar test with php3 to verify this?

Regards,
Monty

--
PHP 3 Mailing List   http://www.php.net/
To unsubscribe send an empty message to php3-unsubscribe <email protected>
To subscribe to the digest list:  php3-digest-subscribe <email protected>
For help: php3-help <email protected>  Archive:  http://www.php.net/mailsearch.php3
List administrator:  zeev-list-admin <email protected>