Jump to content

Php Can't Connect To Mysql Database


villermen

Recommended Posts

I don't know if this is the fault of mysql or IIS...I've recently bought and installed a new computer, now I want to host my website on this new one.After much troubling i've managed to run PHP on IIS 7.5.My MySQL server runs fine too, I can log into it with the command line client.Specs:PHP version 5(.3 or .2)MySQL version 5.5IIS version 7.5PHP runs from the pages, all functions seem to work.Now the problem:Whenever I try to connect with my mysql from a php page it can't connect.When I show the mysql_error(), it will output an error in dutch, this is my attempt to translate it:A connection attempt failed because the connected party did not answer correctly after a set time, or the connection failed because the host didn't answer it.The error in dutch is:Een verbindingspoging is mislukt omdat de verbonden party niet correct heeft geantwoord na een bepaalde tijd, of de gemaakte verbinding is mislukt omdat de verbonden host niet heeft geantwoord. I have no idea what the fault here is, to be absolutely sure I didn't do anything wrong, here's the php code I've used:

<?php error_reporting(E_ALL);if (!mysql_connect("localhost","root","password"))echo mysql_error();?>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...