#30084 [NEW]: Unable to connect MySQL usng IP Addr

From: Date: Tue, 14 Sep 2004 09:56:23 +0000
Subject: #30084 [NEW]: Unable to connect MySQL usng IP Addr
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-66168@lists.php.net to get a copy of this message
From: pawanwattamwar at gmail dot com Operating system: Windows PHP version: 4.3.8 PHP Bug Type: MySQL related Bug description: Unable to connect MySQL usng IP Addr Description: ------------ When I use ($localhost="10.238.21.140:3306";)i.e. IP addr of my machine insted of 127.0.0.1 or local host .It gives following error : Warning: mysql_connect(): Can't connect to MySQL server on '10.238.21.140' (10061) in c:\program files\easyphp1-7\www\new.php on line 6 Unable to select database Reproduce code: --------------- <? $user="root"; $password=""; $database="mysql"; $localhost="10.238.21.140:3306"; mysql_connect($localhost,$user,$password); @mysql_select_db($database) or die( "Unable to select database"); $query="INSERT INTO contacts VALUES ('','Pawan','Wattamwar','02234 567890','00212 334455','01224 567891','johnsmith@gowansnet.com','http://www.gowansnet.com')"; mysql_query($query); mysql_close(); ?> Expected result: ---------------- blank screen without any error and row inserted in DataBase. Actual result: -------------- Warning: mysql_connect(): Can't connect to MySQL server on '10.238.21.140' (10061) in c:\program files\easyphp1-7\www\new.php on line 6 Unable to select database -- Edit bug report at http://bugs.php.net/?id=30084&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=30084&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=30084&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=30084&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=30084&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=30084&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=30084&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=30084&r=needscript Try newer version: http://bugs.php.net/fix.php?id=30084&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=30084&r=support Expected behavior: http://bugs.php.net/fix.php?id=30084&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=30084&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=30084&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=30084&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=30084&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=30084&r=dst IIS Stability: http://bugs.php.net/fix.php?id=30084&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=30084&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=30084&r=float MySQL Configuration Error: http://bugs.php.net/fix.php?id=30084&r=mysqlcfg

« previous php.bugs (#66168) next »