Can not connect after installation Can not connect after installation
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Can not connect after installation

Started by MSOWebGirl, January 05, 2005, 05:57:46 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

MSOWebGirl

I have performed a search for this error, and I none of these tips are helping.  I have Coppermine installed on two separate servers.  On the first, I have been using it for a few months and it suddenly developed problems.  I installed that through Fantastico and am waiting for a reply from my server (based on a comment from someone with the same upload problem).  My other gallery is on a different server that does not have Fantastico.  I installed this one manually.  It said that the install was successful, but when I try to go to the index page, I get the following error:

Coppermine critical error:
Unable to connect to database !

MySQL said: Access denied for user: 'www-data@localhost' (Using password: NO)

I don't understand why this is happening.  I saw that another poster with this similar issue was told to check his file include/config.inc.php and make sure that the information is valid.  I do not have this file.  The URL to the gallery is http://cgi.michael-shane.com/cpg132/index.php.    If someone can help me, I would greatly appreciate it.

Tranz

Yes, you do have the file. I checked.

Look in the folder called include for a file named config.inc.php

MSOWebGirl

My apologies.  I was looking in the wrong spot.  I looked in this file and all of the information in it is correct.  The username, password, and database are all correct.  Am I missing something somewhere else that is stopping it from connecting? 

Thanks.

Abbas Ali

QuoteMySQL said: Access denied for user: 'www-data@localhost' (Using password: NO)

This error denotes that you are not using password to connect to the database. Make sure that you have correct password

$CONFIG['dbpass'] = "password"

written in config.inc.php
Chief Geek at Ranium Systems

MSOWebGirl

I checked and the password is correct.  I cross-checked it with  my information at my server, and everything is alright.  I don't know why I'm getting that error.

kegobeer

In init.inc.php, right before

require 'include/functions.inc.php';

add this

echo "server: " . $CONFIG['dbserver'] . "<br />dbuser: " . $CONFIG['dbuser'] . "<br />dbpass: " .$CONFIG['dbpass'] . "<br />dname: " . $CONFIG['dbname']";
die();


Do you get the correct values?
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

MSOWebGirl

Now I got the following error message:

Parse error: parse error, expecting `','' or `';'' in /var/www/sites/michael-shane.com/cpg132/include/init.inc.php on line 223

Fatal error: Call to undefined function: breadcrumb() in /var/www/sites/michael-shane.com/cpg132/index.php on line 159

Abbas Ali

Instead of

Quote from: kegobeer on January 06, 2005, 05:14:46 AM

echo "server: " . $CONFIG['dbserver'] . "<br />dbuser: " . $CONFIG['dbuser'] . "<br />dbpass: " .$CONFIG['dbpass'] . "<br />dname: " . $CONFIG['dbname']";
die();



you should write this code

echo "server: " . $CONFIG['dbserver'] . "<br />dbuser: " . $CONFIG['dbuser'] . "<br />dbpass: " .$CONFIG['dbpass'] . "<br />dname: " . $CONFIG['dbname'];
die();


And see whether the values match or not..
Chief Geek at Ranium Systems

kegobeer

Sorry about that last ".  Hey, it was late at night when I wrote it!   ;D
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

MSOWebGirl

Okay, so either I'm still doing something wrong, I'm extremely slow, or both.  Now, all I'm getting is a white page that tells me the information that I put in the fields.

kegobeer

That was the intent.  I wanted to make sure that the fields were correctly populated.  You can remove that line.

Create a new php file with this code:

<?php
$localhost 
'your host name';
$mysql_user 'your mysql user name';
$mysql_password 'your mysql password';
$mysql_database 'your mysql database name';

$link mysql_connect($localhost$mysql_user$mysql_password);
if (!
$link) {
   die(
'Could not connect: ' mysql_error());
}
echo 
'Connected successfully<br />';

$db_selected mysql_select_db($mysql_database$link);
if (!
$db_selected) {
   die (
'Can\'t use ' $mysql_database ': ' mysql_error());
}
mysql_close($link);
?>


Put your database information in the variables.  Upload it to your site and execute the script.  Report back with your results.
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots

MSOWebGirl

I loaded the file and it said, "Connected successfully."  I apologize that it took me so long to get back to you.  I got some bad news on Saturday, and I've been a bit behind on everything. 

Abbas Ali

This means that you are able to connect to the database and all the parameters supplied by you are correct. So what could be the problem  ??? ::).

First make a backup of include/functions.inc.php then open include/functions.inc.php file and find this code

function cpg_db_connect()
{
        global $CONFIG;
        $result = @mysql_connect($CONFIG['dbserver'], $CONFIG['dbuser'], $CONFIG['dbpass']);
        .........
       


and replace it with this code

function cpg_db_connect()
{
        global $CONFIG;
        echo "server: " . $CONFIG['dbserver'] . "<br />dbuser: " . $CONFIG['dbuser'] . "<br />dbpass: " .$CONFIG['dbpass'] . "<br />dbname: " . $CONFIG['dbname'];
        $result = @mysql_connect($CONFIG['dbserver'], $CONFIG['dbuser'], $CONFIG['dbpass']);
        .......


and see whether you get the correct values or not. Check whether dbpass value is correct.
Chief Geek at Ranium Systems

PTWebMiss

Hi, this is the same person, MSOWebGirl.  I had some issues finding my password and such, so it was just easier to make a new one.  Okay... here's the thing.  I've gone back to trying to install this gallery because others were giving me just as many problems and I've liked Coppermine when I used it in the past.  I tried the last thing that was requested for me to do, altering /include/functions.inc.php and all I got when I loaded it up was a blank page.  I've reinstalled the script and the installation went just fine, but I still get the exact same connection error as I was getting before.  I don't know what I'm doing wrong.

kegobeer

Hmm.  That's odd.  You shouldn't get a blank page if all you did was replace

        $result = @mysql_connect($CONFIG['dbserver'], $CONFIG['dbuser'], $CONFIG['dbpass']);

with

        echo "server: " . $CONFIG['dbserver'] . "<br />dbuser: " . $CONFIG['dbuser'] . "<br />dbpass: " .$CONFIG['dbpass'] . "<br />dbname: " . $CONFIG['dbname'];
        $result = @mysql_connect($CONFIG['dbserver'], $CONFIG['dbuser'], $CONFIG['dbpass']);


You should get four lines printed at the top left corner of your page.
Do not send me a private message unless I ask for one.  Make your post public so everyone can benefit.

There are no stupid questions
But there are a LOT of inquisitive idiots