Connecting to MySQL in PHP

Hi guys how r u doing?

Port 80 is used by IIS.
Thus when i run php i use port 81
then it is: localhost:81/

It works fine.
But i want to connect to MySQL:

I get the following error:

Warning: mysql_connect() [function.mysql-connect]: MySQL server has gone away in C:\wamp\www\LesWebDevelopment\ic1s.php on line 17

Warning: mysql_connect() [function.mysql-connect]: Error while reading greeting packet. PID=3796 in C:\wamp\www\LesWebDevelopment\ic1s.php on line 17

Warning: mysql_connect() [function.mysql-connect]: MySQL server has gone away in C:\wamp\www\LesWebDevelopment\ic1s.php on line 17

Fatal error: Maximum execution time of 60 seconds exceeded in C:\wamp\www\LesWebDevelopment\ic1s.php on line 17

I changed the port to 81 my.ini

But i still get error timelimit 60 seconds exceeded

this is the code:

Code:

<?php

$dbhost = 'localhost:81';
$dbuser = 'root';
$dbpass = '';

$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');

$dbname = 'ic1s';
mysql_select_db($dbname);

?>

Thanks in advance

Have you read the following article from the MySQL documentation?

[B]B.5.2.9.[/B] [I]MySQL server has gone away[/I]

That will give you plenty of possibilities and debugging ideas to get started. Unfortunately, without access to the MySQL and Apache servers themselves, there isn’t much we can do to help without more information.

Thanks …

But apache is working on port 81 …

the only thing is now with MySQL

I really depends on how MySQL is configured but I believe the default port is 3306. In any case it will be different from what Apache uses

Thanks a lot …
thats what i needed to know …