You are here: RE: [PHP] Is this a mysql_connect() bug? « PHP « IT news, forums, messages
RE: [PHP] Is this a mysql_connect() bug?

Posted by Michael Sims on 01/30/05 09:16

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)?

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация