Critical Error: Could not connect to database

Frequently asked questions about mySQL and other databases.

Moderator: Moderators

Critical Error: Could not connect to database

Postby UseLess on Mon Sep 26, 2005 1:07 am


If your getting this error;

phpBB : Critical Error

Could not connect to the database

Then either of the following may be true;

1. The database connection information in 'config.php' is wrong.
2. The database service on the server is not running.


Check the information in 'config.php' and make sure the file contains;

Code: Select all

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

$dbms = 'mysql';

$dbhost = 'localhost';
$dbname = '<name of database>';
$dbuser = '<name of user>';
$dbpasswd = '<user password>';

$table_prefix = 'phpbb_';

define('PHPBB_INSTALLED', true);



- '$dbms' is the database type your using, usually 'mysql'.
- '$dbhost is the host where the database server is, usually 'localhost'
- '$dbname' is the name of the database
- '$dbuser' is your username for the account
- '$dbpasswd' is the password for your account

- '$table_prefix' is the prefix applied to the table names, this can be altered if you wish to run more than one forum from a single database.

If the information in the file is correct then possibly the database service on the server is no longer running, if this is the case then you will need to contact your host in order to get them to restart the service.
Movie Quote:
It's not the years honey, it's the mileage...

I do not provide any install services for phpBB, Mods or Styles.
Please do not pm me for support/scripting help - you won't get any reply. If you have a question then make a post in the appropriate forum.
User avatar
Registered User
Registered User
Posts: 6220
Joined: Mon Sep 27, 2004 2:14 am
Location: North East, UK

Return to Database FAQ

Who is online

Users browsing this forum: No registered users and 2 guests