Page 1 of 1

Login Problem

Posted: Mon Oct 10, 2005 1:16 pm
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

Posted: Mon Oct 10, 2005 1:41 pm
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()

Posted: Mon Oct 10, 2005 2:01 pm
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

Posted: Mon Oct 10, 2005 2:03 pm
by John Cartwright
http://php.net/mysql_connect
http://php.net/mysql_select_db

its called reading the documentation :wink:

Posted: Mon Oct 10, 2005 2:25 pm
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?

Posted: Mon Oct 10, 2005 2:47 pm
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.

Posted: Mon Oct 10, 2005 3:12 pm
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

Posted: Mon Oct 10, 2005 3:16 pm
by Burrito
well are those the correct log in credentials for your MySQL server?

can you log in to MySQL from the CLI?

Posted: Mon Oct 10, 2005 3:27 pm
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.

Posted: Mon Oct 10, 2005 3:32 pm
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.