RE: [PHP] Is this a mysql_connect() bug?

From: Date: Sun, 30 Jan 2005 07:16:10 +0000
Subject: RE: [PHP] Is this a mysql_connect() bug?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-207705@lists.php.net to get a copy of this message
tom soyer wrote: > Thanks for the error handling code. I think PHP still has a basic > problem. If mysql sever connection times out because wrong username or > password was used, then mysql_connect() should return FALSE. It does, at least for me on PHP 4.3.10 connecting to a local MySQL 4.0.23 server on Debian. It returns a boolean false, and a warning is triggered: Warning: mysql_connect(): Access denied for user: 'user@localhost' (Using password: YES) in ... If I give it a server name it cannot connect to (due to a firewall blocking the connection, for example) it will hang for about 60 seconds then return false, triggering a warning: Warning: mysql_connect(): Can't connect to MySQL server on ... I was going to suggest that you run a cli test script and trace the system calls to see what's going on but then I saw that you're using Windows. I'm not sure if there is an strace/truss equivalent for it (anyone know)?

« previous php.general (#207705) next »