"...unable to connect to the database" after CentOS update

Started by dand, October 06, 2012, 12:29:30 PM

Previous topic - Next topic

dand

Hi,
I have just upgraded my Linux CentOS server from 5.3 to latest point release 5.8. I all went well. The only thing that stoped working is SMF 1.16 forum, with the following message:

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

There is Plesk control pannel installed on server.

Any ideas, what could have gone wrong?


LiroyvH

Lol from 5.3 to 5.8 is quite the while without updates.

It means that your mySQL database is no longer working correctly.
I guess it was upgraded along with it, and judging by how old your CentOS install was; there might be something in your my.cnf that is deprecated and prevents mySQL from starting. That, or something else is unfortunately wrong.

You will have to look in the command line. Try to start mySQL and see what it does, it will either start in which case you have to look better at why it wont accept details; or it will present a error. (Usually, mySQL just says "failed", check in the corresponding logs for details about *why* it fails)
((U + C + I)x(10 − S)) / 20xAx1 / (1 − sin(F / 10))
President/CEO of Simple Machines - Server Manager
Please do not PM for support - anything else is usually OK.

dand

Thanks.

I think mysql is started ok since I have other software on server that also use databases, like Wordpress, Mantis bugtracker, Mediawiki, etc. They all work ok.

I have just started mysql in command line, logged in and listed existing databases. "smf" is there.   

dand

OK, I think I resolved the problem, even it I still don't understand how it came about at first place.

I just changed the username in Settings.php and it works now.
Username was set to my forum username.
Now I have changed it to "admin" since mysql admin is "admin".

Does that make sense?
Which username should be in Settings.php?

mashby

It should be the database username, not your forum username, as you've now discovered. :)
Always be a little kinder than necessary.
- James M. Barrie

dand

But how could this happen? I need a reasonable explanation. How come there was my forum username in Settings.php? And why it worked so far?

I forgot at what point was database created, and with what username?

Worried...

LiroyvH

((U + C + I)x(10 − S)) / 20xAx1 / (1 − sin(F / 10))
President/CEO of Simple Machines - Server Manager
Please do not PM for support - anything else is usually OK.

dand


LiroyvH

If you used that to connect to SQL as well (admin has rights to access databases afaik, just like "root" does if added to the database *) when you set the forum up, it might have happened that you either A.) Changed password for "admin" or B.) "admin" has been, since the SQL upgrade, not been allowed to connect to the database(s0.
((U + C + I)x(10 − S)) / 20xAx1 / (1 − sin(F / 10))
President/CEO of Simple Machines - Server Manager
Please do not PM for support - anything else is usually OK.

dand

Quote from: CoreISP on October 07, 2012, 12:27:38 PM
If you used that to connect to SQL as well (admin has rights to access databases afaik, just like "root" does if added to the database *) when you set the forum up, it might have happened that you either A.) Changed password for "admin" or B.) "admin" has been, since the SQL upgrade, not been allowed to connect to the database(s0.

That would make sense but - no. You got that wrong: I am *now* using "admin", and it works. Before the forum upgrade, I used my forum username instead of admin. So, why did forum username work before the upgrade???

ziycon

what version of PHP did you have with 5.3 and what version are you running now on 5.8?

LiroyvH

That will only have worked if the username to access your forum was identical towards the user added to the database.

It doesn't make much sense now; you said your forum username was in there. I ask if that username is equal to what you use to login with Plesk; you say yes: admin. Then I reply and you say you didn't use it but are using it now :P What is it? :)
Isn't there a user account on Plesk by the way other than "admin" that gives full access to everything? o0
((U + C + I)x(10 − S)) / 20xAx1 / (1 − sin(F / 10))
President/CEO of Simple Machines - Server Manager
Please do not PM for support - anything else is usually OK.

dand

Quote from: CoreISP on October 08, 2012, 08:03:39 AM
That will only have worked if the username to access your forum was identical towards the user added to the database.

It doesn't make much sense now; you said your forum username was in there. I ask if that username is equal to what you use to login with Plesk; you say yes: admin. Then I reply and you say you didn't use it but are using it now :P What is it? :)
Isn't there a user account on Plesk by the way other than "admin" that gives full access to everything? o0

No.

My forum username was my name, so "John Doe". That was in there in Settings.php. And it worked.

Now after I updated OS, it stoped working.

Now after I updated OS, I tried "admin" as username and it works.

(I never changed password as I use the same one for forum and Plesk.)


The question is: why did my "John Doe" username work, and now it doesn't?

dand

Quote from: CoreISP on October 08, 2012, 08:03:39 AM
Isn't there a user account on Plesk by the way other than "admin" that gives full access to everything? o0

No, I don't think there is user account other than "admin" that has full access. I never created one.

LiroyvH

Check for mySQL users that have been added to the database.
Admin (for Plesk) is always added normally, but there should be another user added to the database. Most likely the "John Doe" that used to work should be there somewhere.
((U + C + I)x(10 − S)) / 20xAx1 / (1 − sin(F / 10))
President/CEO of Simple Machines - Server Manager
Please do not PM for support - anything else is usually OK.

Advertisement: