SMF WAS UNABLE TO CONNECT TO THE DATABASE???

Started by brandonmccoy, August 05, 2008, 12:02:49 PM

Previous topic - Next topic

brandonmccoy

WHEN I TYPE IN MY SITE URL THIS WHAT IT SAYS

Sorry, SMF was unable to connect to the database. This may be caused by the server being busy. Please try again later.

ANY SUGGESTIONS ON WHAT TO DO
IF I HAVE TO REINSTALL SMF
IT WOULDNT SET ME BACK TO MUCH
CUZ I INSTALLED SMF JUST YESTERDAY

Angelotus

It could be caused by other things, like your server is down -> contact your host
Or your settings are incorrect. Try repair settings: run the repair_settings.php file and click on all the blue recommended values to update all the paths, urls and the other settings and when you are done, delete it. Like this, all mods and custom themes that you have will be preserved intact

Or, you can simply install a new smf at the new host and then import the database and do the thing with the repair_settings.php. Only thing, you will loose all mods and custom themes that you had.

Hope it helps

How to backup and restore the database, have a look at this topic

http://www.simplemachines.org/community/index.php?topic=184356.0

brandonmccoy

ok thanks
i mite swich my hosts
cuz there always having server problems

ccbtimewiz

Make sure all the database information is filled out correctly in the settings.php file.

nachokhan

Hi there. First of all, sory about my english, but i don´t speak it very well..  ;)

I had the same error message when trying to enter my new SMF Forum. As somebody said i saw the setting.php file, and i realize that the problem was in the dabatse configuration. It was very extrange, because it said that de db_user whas the mail of the last registered user (wich I put as Admin). I don´t know if this could be the root of the problem (to change him to Admin)... So i changed it with my MySQL user and ir worked!

I would like to know what could be the problem exactly..

Thank you! :D

froodle

I had exactly the same problem today. All this time the server is okay as I have a couple of websites with the same server and they work fine apart from SMF.
I haven't change anything and it worked all this time apart from today.

Sorry, SMF was unable to connect to the database. This may be caused by the server being busy. Please try again later.



Quote from: Angelotus on August 05, 2008, 12:19:11 PM
It could be caused by other things, like your server is down -> contact your host
Or your settings are incorrect. Try repair settings: run the repair_settings.php file and click on all the blue recommended values to update all the paths, urls and the other settings and when you are done, delete it. Like this, all mods and custom themes that you have will be preserved intact

Or, you can simply install a new smf at the new host and then import the database and do the thing with the repair_settings.php. Only thing, you will loose all mods and custom themes that you had.

Hope it helps

How to backup and restore the database, have a look at this topic

http://www.simplemachines.org/community/index.php?topic=184356.0

Adish - (F.L.A.M.E.R)

Quote from: froodle on October 02, 2008, 06:01:20 PM
I had exactly the same problem today. All this time the server is okay as I have a couple of websites with the same server and they work fine apart from SMF.
I haven't change anything and it worked all this time apart from today.

Sorry, SMF was unable to connect to the database. This may be caused by the server being busy. Please try again later.



Quote from: Angelotus on August 05, 2008, 12:19:11 PM
It could be caused by other things, like your server is down -> contact your host
Or your settings are incorrect. Try repair settings: run the repair_settings.php file and click on all the blue recommended values to update all the paths, urls and the other settings and when you are done, delete it. Like this, all mods and custom themes that you have will be preserved intact

Or, you can simply install a new smf at the new host and then import the database and do the thing with the repair_settings.php. Only thing, you will loose all mods and custom themes that you had.

Hope it helps

How to backup and restore the database, have a look at this topic

http://www.simplemachines.org/community/index.php?topic=184356.0

Check settings.php, there should be some information which is not right. This is caused when there is wrong information in settings.php

Also it maybe temporary as the main server maybe booted and hence you wouldnt be able to do it for that moment. ?

froodle

#7
After a few days the error is the same. This is my settings.php, please tell me what's wrong with it, as I haven't touched it.

<?php
/**********************************************************************************
* Settings.php                                                                    *
***********************************************************************************
* SMF: Simple Machines Forum                                                      *
* Open-Source Project Inspired by Zef Hemel ([email protected])                    *
* =============================================================================== *
* Software Version:           SMF 1.1                                             *
* Software by:                Simple Machines (http://www.simplemachines.org)     *
* Copyright 2006 by:          Simple Machines LLC (http://www.simplemachines.org) *
*           2001-2006 by:     Lewis Media (http://www.lewismedia.com)             *
* Support, News, Updates at:  http://www.simplemachines.org                       *
***********************************************************************************
* This program is free software; you may redistribute it and/or modify it under   *
* the terms of the provided license as published by Simple Machines LLC.          *
*                                                                                 *
* This program is distributed in the hope that it is and will be useful, but      *
* WITHOUT ANY WARRANTIES; without even any implied warranty of MERCHANTABILITY    *
* or FITNESS FOR A PARTICULAR PURPOSE.                                            *
*                                                                                 *
* See the "license.txt" file for details of the Simple Machines license.          *
* The latest version can always be found at http://www.simplemachines.org.        *
**********************************************************************************/


########## Maintenance ##########
# Note: If $maintenance is set to 2, the forum will be unusable!  Change it to 0 to fix it.
$maintenance = 0; # Set to 1 to enable Maintenance Mode, 2 to make the forum untouchable. (you'll have to make it 0 again manually!)
$mtitle = 'Maintenance Mode'; # Title for the Maintenance Mode message.
$mmessage = 'Okay faithful users...we\'re attempting to restore an older backup of the database...news will be posted once we\'re back!'; # Description of why the forum is in maintenance mode.

########## Forum Info ##########
$mbname = 'Froodle BlackHat Forum'; # The name of your forum.
$language = 'english'; # The default language file set for the forum.
$boardurl = 'http://www.froodle.net/blackhat'; # URL to your forum's folder. (without the trailing /!)
$webmaster_email = '[email protected]'; # Email address to send emails from. (like [email protected].)
$cookiename = 'SMFCookie892'; # Name of the cookie to set for authentication.

########## Database Info ##########
$db_server = 'localhost';
$db_name = '';
$db_user = '';
$db_passwd = '';
$db_prefix = 'smf_blackhat';
$db_persist = 0;
$db_error_send = 1;

########## Directories/Files ##########
# Note: These directories do not have to be changed unless you move things.
$boarddir = '/home/dilligaf/public_html/blackhat'; # The absolute path to the forum's folder. (not just '.'!)
$sourcedir = '/home/dilligaf/public_html/blackhat/Sources'; # Path to the Sources directory.

########## Error-Catching ##########
# Note: You shouldn't touch these settings.
$db_last_error = 1223230199;


# Make sure the paths are correct... at least try to fix them.
if (!file_exists($boarddir) && file_exists(dirname(__FILE__) . '/agreement.txt'))
$boarddir = dirname(__FILE__);
if (!
file_exists($sourcedir) && file_exists($boarddir . '/Sources'))
$sourcedir = $boarddir . '/Sources';

?>



I have deleted database info here, but not on the actual file.

Crasy

Instead of instructing you through the possibly tedious process of editing that file. (You'll be more likely to break it if you don't understand it)

Download the file found here:
http://www.simplemachines.org/download/index.php?thanks;filename=repair_settings.php

Upload it to your forum, via FTP. I should go in the main directory of the forum.

Using your web browser, view the file.
Fill out the database name, user and password. If needed, also change the database host.

Your host will provide the information you need when you create a database on your host.


Adish - (F.L.A.M.E.R)

Quote from: froodle on October 05, 2008, 06:56:50 PM
After a few days the error is the same. This is my settings.php, please tell me what's wrong with it, as I haven't touched it.

<?php
/**********************************************************************************
* Settings.php                                                                    *
***********************************************************************************
* SMF: Simple Machines Forum                                                      *
* Open-Source Project Inspired by Zef Hemel ([email protected])                    *
* =============================================================================== *
* Software Version:           SMF 1.1                                             *
* Software by:                Simple Machines (http://www.simplemachines.org)     *
* Copyright 2006 by:          Simple Machines LLC (http://www.simplemachines.org) *
*           2001-2006 by:     Lewis Media (http://www.lewismedia.com)             *
* Support, News, Updates at:  http://www.simplemachines.org                       *
***********************************************************************************
* This program is free software; you may redistribute it and/or modify it under   *
* the terms of the provided license as published by Simple Machines LLC.          *
*                                                                                 *
* This program is distributed in the hope that it is and will be useful, but      *
* WITHOUT ANY WARRANTIES; without even any implied warranty of MERCHANTABILITY    *
* or FITNESS FOR A PARTICULAR PURPOSE.                                            *
*                                                                                 *
* See the "license.txt" file for details of the Simple Machines license.          *
* The latest version can always be found at http://www.simplemachines.org.        *
**********************************************************************************/


########## Maintenance ##########
# Note: If $maintenance is set to 2, the forum will be unusable!  Change it to 0 to fix it.
$maintenance = 0; # Set to 1 to enable Maintenance Mode, 2 to make the forum untouchable. (you'll have to make it 0 again manually!)
$mtitle = 'Maintenance Mode'; # Title for the Maintenance Mode message.
$mmessage = 'Okay faithful users...we\'re attempting to restore an older backup of the database...news will be posted once we\'re back!'; # Description of why the forum is in maintenance mode.

########## Forum Info ##########
$mbname = 'Froodle BlackHat Forum'; # The name of your forum.
$language = 'english'; # The default language file set for the forum.
$boardurl = 'http://www.froodle.net/blackhat'; # URL to your forum's folder. (without the trailing /!)
$webmaster_email = '[email protected]'; # Email address to send emails from. (like [email protected].)
$cookiename = 'SMFCookie892'; # Name of the cookie to set for authentication.

########## Database Info ##########
$db_server = 'localhost';
$db_name = '';
$db_user = '';
$db_passwd = '';
$db_prefix = 'smf_blackhat';
$db_persist = 0;
$db_error_send = 1;

########## Directories/Files ##########
# Note: These directories do not have to be changed unless you move things.
$boarddir = '/home/dilligaf/public_html/blackhat'; # The absolute path to the forum's folder. (not just '.'!)
$sourcedir = '/home/dilligaf/public_html/blackhat/Sources'; # Path to the Sources directory.

########## Error-Catching ##########
# Note: You shouldn't touch these settings.
$db_last_error = 1223230199;


# Make sure the paths are correct... at least try to fix them.
if (!file_exists($boarddir) && file_exists(dirname(__FILE__) . '/agreement.txt'))
$boarddir = dirname(__FILE__);
if (!
file_exists($sourcedir) && file_exists($boarddir . '/Sources'))
$sourcedir = $boarddir . '/Sources';

?>



I have deleted database info here, but not on the actual file.

have u removed the passwords and other information or it was like that only ? if not then u need to add in the information in order to make it connect to the database.

froodle

Yes I have removed it, but they are still in original file on the server. I have removed it just to show you what's wrong with the file.

froodle

I have done and followed the instructions, but still no luck.
I do own another forum on the same domain name and server and don't have any problem at all.

Help! :'(

Adish - (F.L.A.M.E.R)

I am putting a blind shot in here as i dont have any details which might be useful for me.

Different servers have different type of database server. Try checking that.

If not then check again that the username and passwords are right or wrong.

froodle

Just done the new database with new user name and password, and still nothing works. I find this very strange as my other sites are working fine, and server is working with no probs, I did ask them.

Adish - (F.L.A.M.E.R)

can you pm me the whole settings.php without any removal of the information ?

and also the settings.php or the main site which is working.

Crasy

Does you host actually keep the database on localhost?

Most hosts I know of require a different hostname for the databases.

froodle

Quote from: Crasy on October 06, 2008, 05:09:29 PM
Does you host actually keep the database on localhost?

Most hosts I know of require a different hostname for the databases.

Answer to that is, yes it does. Problem still exist. I just can't understand that, other two forums are fine, just this one gone.

Adish - (F.L.A.M.E.R)

Updating here.

I got confused here at the moment. In which folder is smf loaded ? i dont even see your settings.php in public_html

Can you give me the paths where smf is and where it doesnt connect to the server ?

青山 素子

froodle, can you try the repair_settings script from our downloads area? It will not only let you adjust any broken settings, but will also try to connect to the database (to get ones stored there). If it complains about the database information being incorrect, it probably is.
Motoko-chan
Director, Simple Machines

Note: Unless otherwise stated, my posts are not representative of any official position or opinion of Simple Machines.


Advertisement: