If you reach to maximum mysql connection limit or link limit, mysql_connect will fail.
Check limits and current fullness.
-------Original Message-------
Date: 21 Ağustos 2003 Perşembe 11:32:47
Subject: Re: PHP mysql_connect randomly failing
Antony Dovgal wrote:
> On Tue, 19 Aug 2003 14:36:15 -0700 > Jon Drukman <[EMAIL PROTECTED]> wrote:
>>Approximately 1% of the time it just fails, for no stated reason: >> >>Warning: mysql_connect() [http://www.php.net/function.mysql-connect]: >>in /var/httpd/htdocs/pi/pi.php on line 3 >>mysql connect failed: >> >>Any ideas why this would be happening? PHP is version 4.3.1 (same >>results with the latest 4.3.3 release candidate), Mysql is 4.0.12 > > You should turn > track_errors = On > in your php.ini (default value is Off), if you want to see last PHP error in $php_errmsg variable. > > But I suppose the best solution would be not to use $php_errmsg, but to use mysql_error() - > at least this function does not depend on configuration settings.
mysql_error is not set when mysql_connect fails, because there is no actual mysql resource to get the error message from.
anyway i set track_errors=on (confirmed with phpinfo()) but i still get the same message as above - no error is reported.
-jsd-
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED] . |