ID: 44471
Updated by: [EMAIL PROTECTED]
Reported By: jad at hungover dot org
-Status: Open
+Status: Feedback
Bug Type: MySQL related
Operating System: RHEL3
PHP Version: 5.2.5
New Comment:
Works for me:
php > var_dump(mysql_connect('192.168.1.102:3308','root','...'));
resource(1) of type (mysql link)
Which libmysql version are you using and might you create a tcpdump log
or similar so we can analyze that? Thanks.
Previous Comments:
------------------------------------------------------------------------
[2008-03-19 00:31:45] jad at hungover dot org
Sorry, that made no difference - same results as before.
------------------------------------------------------------------------
[2008-03-18 21:47:40] [EMAIL PROTECTED]
Please try using this CVS snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows (zip):
http://snaps.php.net/win32/php5.2-win32-latest.zip
For Windows (installer):
http://snaps.php.net/win32/php5.2-win32-installer-latest.msi
------------------------------------------------------------------------
[2008-03-18 17:57:14] jad at hungover dot org
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 this bug report at http://bugs.php.net/?id=44471&edit=1