Page 1 of 1

mysql help, seriously weird problem

Posted: 2005-10-28 07:05pm
by Spyder
Can anyone figure this one out? I've got a database and web server set up on one machine, I set up both on my laptop for demo purposes, database seems to be working, I can log into phpMyAdmin fine, my database imported fine too, however when I try to connect to it I get an error.

Now, as far as I can tell, everything is set up exactly as it was on the other machine. the mySQL version on the first machine is 4.1.11 where as the newer one is 4.1.15, but that should have only had an impact on importing the database (I think), which worked fine anyway.

This is the contents of connection.php

Code: Select all

<? 

// Connection file contains variables that control the connection to mySQL. 
// $mysql_host: the host machine containing mySQL server ("localhost" if same as webserver)
// $mysql_username: Username/Login for mySQL database
// $mysql_password: Password for mySQL username/login
// $mysql_db: name of the database to be used.
// 
// 

$mysql_host = "localhost";
$mysql_username = "root";
$mysql_password = "****************";
$mysql_db = "lanman";
$conn = mysql_connect($mysql_host, $mysql_username, $mysql_password) or die("Connection error");
mysql_select_db($mysql_db, $conn);
?>
phpMyAdmin says:

"Welcome to phpMyAdmin 2.6.2
MySQL 4.1.15-nt running on localhost as root@localhost"

The output whenever connection.php is included:
"Connection Error"

What have I forgotten to do?

Also of note: The connection works fine on the other machine.

Posted: 2005-10-28 09:10pm
by Dalton
Do you have the right version of PHP on it? That might cause an error...?

Posted: 2005-10-28 11:52pm
by Pu-239
Can you connect to the DB using the command line client?

Posted: 2005-10-29 01:41am
by Spyder
Rob: Same version as on the main machine.

Pu-239: Yes, and I can execute queries on it that way.