<?php
$con = mysql_connect("localhost:8080","root","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
// some code
?>
Then I get the following error:
- Code: Select all
Warning: mysql_connect() [function.mysql-connect]: Lost connection to MySQL server at 'reading initial communication packet', system error: 0 in C:\xampp\htdocs\test.php on line 2
Fatal error: Maximum execution time of 60 seconds exceeded in C:\xampp\htdocs\test.php on line 2
What can be wrong? It's should be pretty simple, but it's not working...
I'm running IIS on port:80 therefore I've changed apache to run on port:8080, and I can view the startpage for XAMPP and all that, and do simple code like "Hello world", but it's the connection to the database that doesn't work. In phpMyAdmin i have like this:
- Code: Select all
root 127.0.0.1 No ALL PRIVILEGES Yes
root localhost No ALL PRIVILEGES Yes
root localhost:8080 No ALL PRIVILEGES Yes
...so I thing I've covered both kinds of ports (80 and 8080), and in my case it's localhost:8080.
But, still not working. Does anyone have any suggestions? How can I resolve this?