Critical Error: Could not connect to database

This is an archive of the phpBB 2.0.x support forum. Support for phpBB2 has now ended.
Forum rules
Following phpBB2's EoL, this forum is now archived for reference purposes only.
Please see the following announcement for more information: viewtopic.php?f=14&t=1385785
Locked
cessax
Registered User
Posts: 16
Joined: Wed Sep 04, 2002 8:16 pm

Critical Error: Could not connect to database

Post by cessax » Sat Oct 02, 2004 4:59 pm

Hi, just wondering how I can fix the 'could not connect to database error' - would this have to do with my sql or something else within the php code? thanks

collin

stormin4
Registered User
Posts: 24
Joined: Sat Oct 02, 2004 5:14 pm
Contact:

Post by stormin4 » Sat Oct 02, 2004 5:17 pm

I had the same problem. Make sure you use "username" = root and password leave blank.

cessax
Registered User
Posts: 16
Joined: Wed Sep 04, 2002 8:16 pm

different solution...

Post by cessax » Sat Oct 02, 2004 5:32 pm

hi, actually i found a post that was made over a year ago and the person said there config file needed to be changed, or that it was changed somehow. i looked at my config.php file and found that mySQL database server name had been changed by my hosting provider, so i updated the new database server name in my config.php file and everything seems to be working once again! thanks for your advice though!

collin

tristatesportbikes
Registered User
Posts: 14
Joined: Tue Jun 15, 2004 12:54 am

config.php

Post by tristatesportbikes » Sun Oct 03, 2004 1:26 am

I had a client over write the config.php file with one from another board. am now getting the could not connect to database. How can i recreate the file? I tried to create a board with the same username and password as the orginal and the encripted password is giving an SQL error.
Next I tried to create a new board and uploaded the mysql database to the new board, without logging in, i can see all the threads and the board loos fine. When I try to log in I get this error.

Warning: mysql_connect(): Access denied for user: 'lafemmes_phpbb1@localhost' (Using password: YES) in /home/lafemmes/public_html/forum/db/mysql4.php on line 48

Warning: mysql_error(): supplied argument is not a valid MySQL-Link resource in /home/lafemmes/public_html/forum/db/mysql4.php on line 330

Warning: mysql_errno(): supplied argument is not a valid MySQL-Link resource in /home/lafemmes/public_html/forum/db/mysql4.php on line 331
phpBB : Critical Error

Could not connect to the database


Any help would be greatly appreciated.

Thanks,
\Gary

cessax
Registered User
Posts: 16
Joined: Wed Sep 04, 2002 8:16 pm

database error...

Post by cessax » Sun Oct 03, 2004 3:52 am

I fixed this database connection error by finding my config.php file and editing it - you don't have to switch database's or do a new board. its quite simple, find the original config.php file and rename it config2.php or something so you have a backup of the original. Then, edit the original config.php file and save it as config.php - just keep the config2 for backup incase this doesn't work...now, make sure your sql server address, username, and password are all correct. I ran into problems because my website provider changed my sql server so all i had to do was update my sql server address. I don't know what else could be the problem, but don't give up - you will find answers in this forum GUARENTEED! search, post, and just wait! Good luck! let me know if this works!

Collin D.

ps - after you used another persons config file, its realizing yes you do have a database, but you receive these multiple errors because none of the core information is right (sql location, usernma,e passwords, etc). If you are using someone else's config which is specified to THEIR forum, not yours, it will screw a lot up.

tristatesportbikes
Registered User
Posts: 14
Joined: Tue Jun 15, 2004 12:54 am

Post by tristatesportbikes » Sun Oct 03, 2004 4:10 am

I already tried that and the password is encrypted in the config.php file, that is where the problem is,

User avatar
pentapenguin
Former Team Member
Posts: 11030
Joined: Thu Jul 01, 2004 4:15 am
Location: GA, USA

Post by pentapenguin » Sun Oct 03, 2004 4:12 am

tristatesportbikes wrote: I already tried that and the password is encrypted in the config.php file

Are you sure you're looking in the right place because the password in config.php is in plain text but the database passwords are encrypted.
Support Resources: Support Request Template
If you need professional assistance with your board, please contact me for my reasonable rates.

tristatesportbikes
Registered User
Posts: 14
Joined: Tue Jun 15, 2004 12:54 am

Post by tristatesportbikes » Sun Oct 03, 2004 4:15 am

THis is the contents of the file.

<?php


// phpBB 2.x auto-generated config file
// Do not change anything in this file!

$dbms = 'mysql4';

$dbhost = 'localhost';
$dbname = 'lafemmes_phpbb1';
$dbuser = 'lafemmes_phpbb1';
$dbpasswd = 'xYOcUbgfgq';

$table_prefix = 'phpbb_';

define('PHPBB_INSTALLED', true);

?>

THe DB password is the one that is getting me.

User avatar
pentapenguin
Former Team Member
Posts: 11030
Joined: Thu Jul 01, 2004 4:15 am
Location: GA, USA

Post by pentapenguin » Sun Oct 03, 2004 4:17 am

tristatesportbikes wrote: $dbpasswd = 'xYOcUbgfgq';

Is that password what your host told you to use?
If so, then the password isn't a problem.
Support Resources: Support Request Template
If you need professional assistance with your board, please contact me for my reasonable rates.

tristatesportbikes
Registered User
Posts: 14
Joined: Tue Jun 15, 2004 12:54 am

Post by tristatesportbikes » Sun Oct 03, 2004 4:24 am

I am the host, i created the forum this file is created automatically and the password is encrypted, No that isn't the password, that i used.

THis is the whole problem, it seems that it get encripted in this file and i can't recreate it..

User avatar
thecharmed01
Former Team Member
Posts: 2637
Joined: Sun May 16, 2004 10:07 am
Location: Wellington, NZ
Contact:

Post by thecharmed01 » Sun Oct 03, 2004 4:26 am

cant you just edit the password back to what it should be and re-upload it?
Please refrain from PM'ing me for support unless I specifically ask you to.......

Helpful Pages: ~ [Styles FAQ] ~ [Styles User Guide] ~ [Styles Submission Policy]
My Site: [C1 Web Design]
| Mummy | Web Designer | Slave | Digi-Scrap Addict | Vampire |

Locked

Return to “2.0.x Support Forum”