Author Topic: Could not connect to the database. Please verify your login details and database  (Read 664 times)

techshots

  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Hi,

I've edited the 

C:\wamp\www\CompactCMS\lib\sitemap.php

file, but get that error.

Before that error, I received the following:

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in C:\wamp\www\CompactCMS\lib\sitemap.php on line 218

My edit is as follows (I've left " db_pass " alone because my password is blank)

= @mysql_connect($cfg['localhost'], $cfg['root'], $cfg['db_pass']);
           @mysql_select_db($cfg['compactcms'], $link);


This is all done with wamp = php ver 5.2.0  | mysql 5.3.1  | apache 2.2.11 windows vista


And my install is here:

C:\wamp\www\CompactCMS

Thanks,
HN


Xander

  • Developer
  • Administrator
  • Full Member
  • *****
  • Posts: 240
  • Karma: +5/-0
    • View Profile
    • CompactCMS.nl
Hi Techshots,

I realize that due to my absence, chances are that you already moved on. But just to make sure: have you edited the database settings in /lib/config.inc.php? You mention editing sitemap, but should not be necessary. The error you're getting indicates incorrect values of the login details, which could thus be explained by not having edited config.inc.php.

Also just to check (if still applicable): what version are you using?

Cheers!
Xander.
Don't ever hold back your suggestions. Help me either to improve CompactCMS or spread the word about it on sites such as Twitter, Digg, StumbleUpon, etc :). Thanks!

higgsken

  • Newbie
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Hi Techshots,

I also had this same problem, until I realised that there is a minor typographical error in the Installation Instructions (on the Documentation page).

At "Step 2. Edit configuration file", it says (currently) "Open the file /lib/sitemap.php "... and edit the variables. I think the developer meant to say: "Open the file /lib/config.inc.php "... etc.

Leave the sitemap.php file alone. Do not change it. Instead, change the database connection variables in the config.inc.php file.

  • // Database settings (case sensitive)
    $cfg['db_host']
    $cfg['db_user']
    $cfg['db_pass']
    $cfg['db_name']

Hope this helps anyone else with this problem. KH ;)

Xander

  • Developer
  • Administrator
  • Full Member
  • *****
  • Posts: 240
  • Karma: +5/-0
    • View Profile
    • CompactCMS.nl
Hi all,

One thing is for sure: it helped me in getting the documentation right again :). Changed the instruction in the documentation, so that it doesn't confuse any other enthusiasts trying to install CCMS. Thanks for the heads-up!

Cheers,
Xander.

P.s.: I'm working on an installer, which should make things even more easy :)
Don't ever hold back your suggestions. Help me either to improve CompactCMS or spread the word about it on sites such as Twitter, Digg, StumbleUpon, etc :). Thanks!