mysql help, seriously weird problem

GEC: Discuss gaming, computers and electronics and venture into the bizarre world of STGODs.

Moderator: Thanas

Post Reply
User avatar
Spyder
Sith Marauder
Posts: 4465
Joined: 2002-09-03 03:23am
Location: Wellington, New Zealand
Contact:

mysql help, seriously weird problem

Post 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.
:D
User avatar
Dalton
For Those About to Rock We Salute You
For Those About to Rock We Salute You
Posts: 22637
Joined: 2002-07-03 06:16pm
Location: New York, the Fuck You State
Contact:

Post by Dalton »

Do you have the right version of PHP on it? That might cause an error...?
Image
Image
To Absent Friends
Dalton | Admin Smash | Knight of the Order of SDN

"y = mx + bro" - Surlethe
"You try THAT shit again, kid, and I will mod you. I will
mod you so hard, you'll wish I were Dalton." - Lagmonster

May the way of the Hero lead to the Triforce.
User avatar
Pu-239
Sith Marauder
Posts: 4727
Joined: 2002-10-21 08:44am
Location: Fake Virginia

Post by Pu-239 »

Can you connect to the DB using the command line client?

ah.....the path to happiness is revision of dreams and not fulfillment... -SWPIGWANG
Sufficient Googling is indistinguishable from knowledge -somebody
Anything worth the cost of a missile, which can be located on the battlefield, will be shot at with missiles. If the US military is involved, then things, which are not worth the cost if a missile will also be shot at with missiles. -Sea Skimmer


George Bush makes freedom sound like a giant robot that breaks down a lot. -Darth Raptor
User avatar
Spyder
Sith Marauder
Posts: 4465
Joined: 2002-09-03 03:23am
Location: Wellington, New Zealand
Contact:

Post by Spyder »

Rob: Same version as on the main machine.

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