News:

Wondering if this will always be free?  See why free is better.

Main Menu

Sorry, SMF was unable to connect to the database.

Started by thegamedesigner, August 21, 2015, 12:26:23 PM

Previous topic - Next topic

thegamedesigner

Hey folks!
My forum isn't working. When I navigate to it, it says:

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


It was working for a couple of days, but then this happened. I didn't change anything that I can think of.

I uploaded a phpinfo.php, here: hxxp:michaeltoddgames.com/forum/phpinfo.php [nonactive]

I am aware there is another topic with the same problem, but I tried their fixes, and none of them worked for me.
It is also 3 years old, so I thought I'd start a new one.
This is the topic I'm referring to: simplemachines.org/community/index.php?topic=466617.0


I'm rather a noob in these areas. Any suggestions?

- Michael

Illori

have you tried to contact your host and see if they can help?

thegamedesigner

Yes, I've started a ticket with them. They can't find any problem with the mySQL database, and are blaming the SMF/how I've set it up.

Which is fair, it might be that. Is there anything you can suggest that I should ask them to try? Reset the database, I guess?

Kindred

well, Can you confirm with your host that the database settings (database server, database name, database user/password, database port) are all correct?
(those are listed in your Settings.php file, since you can't get to the admin section)
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

thegamedesigner

Yes, I can do this.

Dumb question maybe, but which set of entries in Settings.php do I care about in this case? Is it the following?

$db_type = 'mysql';
$db_server = 'localhost';
$db_name = 'notmyactualname';
$db_user = 'root';
$db_passwd = 'notmyactualpassword';

Thanks! I'll go root around and make sure these match the database information and ask my host.

Illori

those would be them... i do hope you are not really using the root user though.

thegamedesigner

I am not using the root user.


I talked to my host. They fixed it, in that they helped me correctly set my Settings.php. Now it looks like this:
$db_type = 'mysql';
$db_server = 'localhost';
$db_name = 'notquitemyrealdbname_SMF';
$db_user = 'notmyrealuser';
$db_passwd = 'notmyrealpw';


However, every link on the page leads to an error, "This webpage is not available ERR_CONNECTION_REFUSED"

The link it goes to looks like this: hxxp:127.0.0.1/smf/index.php?PHPSESSID=dr472j1t4sjc2p6tlae6dcqki0&action=register [nonactive]

Any ideas? This is weird, and as far as I can search, not a problem that anyone else has posted here about.

Kindred

Ah....   

Ok, now that you have the DATABASE correct, you need to correct the paths and URLs.

use this:
http://wiki.simplemachines.org/smf/Repair_settings.php
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

ApplianceJunk

Wonder why your $db_name changed in the first place.

Jeremy M.

This happened to me earlier this week.  login to your cpanel, and back sure the database user there as FULL permissions.

Deaks

Quote from: ApplianceJunk on August 21, 2015, 03:42:55 PM
Wonder why your $db_name changed in the first place.

Host could have made updates and forgot to notify, sounds like shared hosting.

Quote from: ukcatsfan83 on August 24, 2015, 01:54:53 AM
This happened to me earlier this week.  login to your cpanel, and back sure the database user there as FULL permissions.
I would more suggest as Kindred advised running repair_settings.php will fix path issues alot quicker.
~~~~
Former SMF Project Manager
Former SMF Customizer

"For as lang as hunner o us is in life, in nae wey
will we thole the Soothron tae owergang us. In truth it isna for glory, or wealth, or
honours that we fecht, but for freedom alane, that nae honest cheil gies up but wi life
itsel."

Geremia16

For me, it was a PHP / php-pgsql (PHP bindings) version mismatch.

Advertisement: