Advanced search  

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]

Pages: [1]   Go Down

Author Topic: Can not connect after installation  (Read 6257 times)

0 Members and 1 Guest are viewing this topic.

MSOWebGirl

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Can not connect after installation
« on: January 05, 2005, 05:57:46 am »

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.
Logged

Tranz

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: 00
  • Offline Offline
  • Gender: Female
  • Posts: 6149
Re: Can not connect after installation
« Reply #1 on: January 05, 2005, 06:08:50 am »

Yes, you do have the file. I checked.

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

MSOWebGirl

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: Can not connect after installation
« Reply #2 on: January 05, 2005, 06:14:04 am »

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.
Logged

Abbas Ali

  • Administrator
  • Coppermine addict
  • *****
  • Country: in
  • Offline Offline
  • Gender: Male
  • Posts: 2165
  • Spread the PHP Web
    • Ranium Systems
Re: Can not connect after installation
« Reply #3 on: January 05, 2005, 12:29:01 pm »

Quote
MySQL 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

Code: [Select]
$CONFIG['dbpass'] = "password"
written in config.inc.php
Logged
Chief Geek at Ranium Systems

MSOWebGirl

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: Can not connect after installation
« Reply #4 on: January 06, 2005, 05:00:04 am »

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.
Logged

kegobeer

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 4637
  • Beer - it does a body good!
    • The Kazebeer Family Website
Re: Can not connect after installation
« Reply #5 on: January 06, 2005, 05:14:46 am »

In init.inc.php, right before

Code: [Select]
require 'include/functions.inc.php';
add this

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


Do you get the correct values?
Logged
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

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: Can not connect after installation
« Reply #6 on: January 06, 2005, 05:26:39 am »

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
Logged

Abbas Ali

  • Administrator
  • Coppermine addict
  • *****
  • Country: in
  • Offline Offline
  • Gender: Male
  • Posts: 2165
  • Spread the PHP Web
    • Ranium Systems
Re: Can not connect after installation
« Reply #7 on: January 06, 2005, 12:25:25 pm »

Instead of


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



you should write this code

Code: [Select]
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..
Logged
Chief Geek at Ranium Systems

kegobeer

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 4637
  • Beer - it does a body good!
    • The Kazebeer Family Website
Re: Can not connect after installation
« Reply #8 on: January 06, 2005, 03:02:58 pm »

Sorry about that last ".  Hey, it was late at night when I wrote it!   ;D
Logged
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

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: Can not connect after installation
« Reply #9 on: January 07, 2005, 02:15:48 am »

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.
Logged

kegobeer

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 4637
  • Beer - it does a body good!
    • The Kazebeer Family Website
Re: Can not connect after installation
« Reply #10 on: January 07, 2005, 03:11:02 am »

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:

Code: [Select]
<?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.
Logged
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

  • Coppermine newbie
  • Offline Offline
  • Posts: 6
Re: Can not connect after installation
« Reply #11 on: January 12, 2005, 01:35:25 am »

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. 
Logged

Abbas Ali

  • Administrator
  • Coppermine addict
  • *****
  • Country: in
  • Offline Offline
  • Gender: Male
  • Posts: 2165
  • Spread the PHP Web
    • Ranium Systems
Re: Can not connect after installation
« Reply #12 on: January 12, 2005, 06:44:57 am »

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

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

and replace it with this code

Code: [Select]
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.
Logged
Chief Geek at Ranium Systems

PTWebMiss

  • Coppermine newbie
  • Offline Offline
  • Posts: 3
Re: Can not connect after installation
« Reply #13 on: March 15, 2005, 11:05:55 pm »

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.
Logged

kegobeer

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 4637
  • Beer - it does a body good!
    • The Kazebeer Family Website
Re: Can not connect after installation
« Reply #14 on: March 16, 2005, 03:07:29 am »

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

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

Code: [Select]
        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.
Logged
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
Pages: [1]   Go Up
 

Page created in 0.022 seconds with 15 queries.