Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

function.mysql-connect: Can't create TCP/IP socket (10106)

Status
Not open for further replies.

nkoepnick

Programmer
Joined
Oct 1, 2002
Messages
3
Location
US
Using PHP 4.3.1 (Server API:ISAPI) & MicroSoft IIS 5.0 & MySQL 4.0.12NT on OS:Windows 2000 as localhost. I am unable to connect to MySQL, using PHP. PHP pages that do not use MySQL are working and I am able to use MySQL from a command line.

Code:

$dbhost = 'localhost';
$dbusername = 'phpusr';
$dbuserpassword = 'pass';
$default_dbname = 'test';
$link_id = mysql_connect($dbhost, $dbusername, $dbuserpassword);
if(!$link_id)
{
$MYSQL_ERRNO = 0;
$MYSQL_ERROR = "Connection to Host: $dbhost FAILED";
die($MYSQL_ERROR);
} else
echo &quot;Successfully made a connection to $dbhost.<br>&quot;;


Results:
Warning: mysql_connect() [function.mysql-connect]: Can't create TCP/IP socket (10106) in c:\inetpub\ on line 13
Connection to Host: localhost FAILED

I have also tried setting $dbhost to these values:
'localhost:3306', '127.0.0.1', '127.0.0.1:3306' to no avail.

Help!
 
That error is about the service. Is it running? Have you got a firewall in your computer?

Anikin
Hugo Alexandre Dias
Web-Programmer
anikin@anikin-skywalker.com
 
That is no I do not have a firewall running locally. Yes I do have the MySQL service running.
 
can you create a telnet connection to the port 3306 ?

telnet localhost 3306

I can try help you if you have windows XP. I could ask for remote assistance to me. You can contact me by MSN messenger (anikin_jedi@hotmail.com)



Anikin
Hugo Alexandre Dias
Web-Programmer
anikin@anikin-skywalker.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top