View Single Post
  #1  
Old 08-15-2006, 08:05 AM
Ibraile Ibraile is offline
Junior Member
 
Join Date: Aug 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
Ibraile is on a distinguished road
Default mysql connection query!

hello there,
I'm trying to connect to mysql using mysql_connet(). The code I use is as follows:

<?php
$link = mysql_connect('localhost', 'root', '*****');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_close($link);
?>

the error I get is:

Quote:
Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on 'localhost' (10061) in c:\programfiler\apache group\Apache\htdocs\web\mysql.php on line 5
Could not connect: Can't connect to MySQL server on 'localhost' (10061)

while connecting to My SQL through windows command prompt with: mysql -h localhost root -p -- and then type the password it works. I can connect.

PHP is installed and running properly. As well as Apache.

I tried to disable my firewall, but it didn't have any effect. plz give some sug -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote
  Webmaster Forums - View Single Post - mysql connection query!
View Single Post
  #1  
Old 08-15-2006, 08:05 AM
Ibraile Ibraile is offline
Junior Member
 
Join Date: Aug 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
Ibraile is on a distinguished road
Default mysql connection query!

hello there,
I'm trying to connect to mysql using mysql_connet(). The code I use is as follows:

<?php
$link = mysql_connect('localhost', 'root', '*****');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_close($link);
?>

the error I get is:

Quote:
Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on 'localhost' (10061) in c:\programfiler\apache group\Apache\htdocs\web\mysql.php on line 5
Could not connect: Can't connect to MySQL server on 'localhost' (10061)

while connecting to My SQL through windows command prompt with: mysql -h localhost root -p -- and then type the password it works. I can connect.

PHP is installed and running properly. As well as Apache.

I tried to disable my firewall, but it didn't have any effect. plz give some sug -- This message may have been cut off and the rest will only be shown to members. To become a member, click here --
Reply With Quote