From: jad at hungover dot org Operating system: RHEL3 PHP version: 5.2.5 PHP Bug Type: MySQL related Bug description: mysql_connect times out when a port is specified
Description: ------------ When using mysql_connect with host:port parameter, with port other than 3306, the connection times out. Am able to telnet to the DB host on the alternative port, with mysql responding as expected. Tried using latest snapshot, as well as 5.2.5 Reproduce code: --------------- <? if( mysql_connect('192.168.151.116:3306','foo','**********') ) { print "3306 connected OK\n"; } else { print "3306 failed connect\n"; } if( mysql_connect('192.168.151.116:3307','foo','**********') ) { print "3307 connected OK\n"; } else { print "3307 failed connect\n"; } ?> Expected result: ---------------- 3306 connected OK 3307 connected OK Actual result: -------------- [EMAIL PROTECTED] default]# /root/newphp/php5.2-200803181530/sapi/cli/php test.php 3306 connected OK Warning: mysql_connect(): Can't connect to MySQL server on '192.168.151.116' (4) in /var/www/sites/default/htdocs/test.php on line 7 3307 failed connect [EMAIL PROTECTED] default]# -- Edit bug report at http://bugs.php.net/?id=44471&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=44471&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=44471&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=44471&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=44471&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=44471&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=44471&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=44471&r=needscript Try newer version: http://bugs.php.net/fix.php?id=44471&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=44471&r=support Expected behavior: http://bugs.php.net/fix.php?id=44471&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=44471&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=44471&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=44471&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=44471&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=44471&r=dst IIS Stability: http://bugs.php.net/fix.php?id=44471&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=44471&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=44471&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=44471&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=44471&r=mysqlcfg