Login Problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
phpete0812
Forum Newbie
Posts: 11
Joined: Mon Oct 10, 2005 1:14 pm
Location: Santa Cruz. CA

Login Problem

Post by phpete0812 »

I'm doing some work on a friend's PHP code.
He uses this code to organize a bunch of work related data.
He sent me the PHP script files and I then uploaded them to my own server.
The PHP pages require a login to access and view.
When I type in the name & password he gave me I get this warning:

Warning: mysql_connect(): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in /home/content/m/e/n/menlo/html/pmtool/goremote/common/CommonLib.php on line 130
Failed to connect to the database ..!

Can anyone tell me what the problem is?

Thanks
Pete
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

if you moved it to a different server, you need to make sure that your mysql connection settings are configured for the new server. More than likely it's a different UN/Pass than what he had on his server.

look for mysql_connect() and mysql_select_db()
phpete0812
Forum Newbie
Posts: 11
Joined: Mon Oct 10, 2005 1:14 pm
Location: Santa Cruz. CA

Post by phpete0812 »

Thanks for the reply, you said to look for mysql_connect() and mysql_select_db().
Where do I look? Once found what happens?
Forgive me, I'm sort of a newbie.

-Pete
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

http://php.net/mysql_connect
http://php.net/mysql_select_db

its called reading the documentation :wink:
phpete0812
Forum Newbie
Posts: 11
Joined: Mon Oct 10, 2005 1:14 pm
Location: Santa Cruz. CA

Post by phpete0812 »

OK, I read the documentation on
mysql_connect & mysql_select_db.
What do I change my settings to and where do I make the changes?
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

that's why I said look for them:

you need to look in your files for them, they're probably being included in your page in question.
phpete0812
Forum Newbie
Posts: 11
Joined: Mon Oct 10, 2005 1:14 pm
Location: Santa Cruz. CA

Post by phpete0812 »

I found this below in a file called config.php

<?php
# define the database connection parameters here.
$DB_HOST = "localhost";
$DB_USER = "gric";
$DB_PASSWORD = "***";
$DB_NAME = "gric";

I then used "***" as my password & username, but got the same warning:

Warning: mysql_connect(): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in /home/content/m/e/n/menlo/html/pmtool/goremote/common/CommonLib.php on line 130
Failed to connect to the database ..!

Jcart | removed database password
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

well are those the correct log in credentials for your MySQL server?

can you log in to MySQL from the CLI?
phpete0812
Forum Newbie
Posts: 11
Joined: Mon Oct 10, 2005 1:14 pm
Location: Santa Cruz. CA

Post by phpete0812 »

I don't think so.
I tried logging in but got the same warning.
What's the CLI? Sorry, I'm a newbie.
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

CLI = command line interface.

well in that case, you're going to need to obtain your MySQL log in credentials and then work from there.
Post Reply