Database connection error

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Database connection error

Postby sebotage » 12. May 2008 18:38

Hi,
I've installed xampp using port 6060 as IIS is using 80. Apache and phpMyAdmin are started and function correctly. I have added a privilege and a database but when I try connect to the database using my pc name and port it doesn't connect or give me an error, it just tries to load endlessly.

Here is my test code.
<?
//connect
$localhost = "station:6060";
$username = "test";
$password = "test123";
$database = "testdb";

mysql_connect($localhost,$username,$password);
@mysql_select_db($database) or die("Unable to select database");

echo 'helloooo';
?>

Tnx,
sebotage
 
Posts: 2
Joined: 12. May 2008 18:31

Postby Wiedmann » 12. May 2008 18:48

Code: Select all
$localhost = "[b]station:6060[/b]";

That must allways be "localhost".
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby sebotage » 13. May 2008 06:44

Hi,
I have tried that with no luck. I have added a Privilege and created a database when adding the Privilege and my test page doesn't connect.

<?
//connect
$localhost = "localhost";
$username = "test";
$password = "test123";
$database = "testdb";

mysql_connect($localhost,$username,$password);
@mysql_select_db($database) or die("Unable to select database");

echo 'helloooo';
?>

Warning: mysql_connect() [function.mysql-connect]: Can't connect to MySQL server on 'localhost' (10061) in C:\data\test\website\live\test.php on line 8
Unable to select database
sebotage
 
Posts: 2
Joined: 12. May 2008 18:31

Postby Wiedmann » 13. May 2008 12:18

I have added a Privilege and created a database

How did you do that?
Wiedmann
AF Moderator
 
Posts: 17102
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby ridgewood » 13. May 2008 13:14

1...If you are running IIS there is a chance that port 3306 is being used by it...run a port check to confirm that. 2... if phpMyAdmin is running, open it and select status-- what does 'Show MySQL runtime information' show?

My experience is that ports 80/3306/443 all need to be changed if IIS is running concurrently.
ridgewood
 
Posts: 57
Joined: 10. January 2005 22:02


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 124 guests