Simple Machines Community Forum

SMF Support => SMF 2.1.x Support => Topic started by: aceone on March 09, 2024, 03:44:29 PM

Title: Database connection keeps failing after upgrade
Post by: aceone on March 09, 2024, 03:44:29 PM
I upgraded my forum from 2.1.1 to 2.1.4.
I upgraded trough upgrade.php which finished without errors, but after that the database connection failed.
I have the repair tool and it says.
QuoteSome settings are not being shown because the database connection information is incorrect.
Check your database login details, table prefix and that the database actually contains your SMF tables.
But every setting is right,
The settings in Settings.php are right.
Access rights of Settings.php are right.
User and group of all files are right.

I can login with mysql -u myuser -p on the server.
I have logging in mysqld on. The only message is:
Quote550 Connect  myuser@localhost on  using Socket
550 Connect  Access denied for user 'myuser'@'localhost' (using password: YES)
Username is right.

I have no idea what's going on.
Title: Re: Database connection keeps failing after upgrade
Post by: Sir Osis of Liver on March 09, 2024, 10:39:30 PM
If you have a backup of 2.1.1, compare database settings in Settings.php with Settings.php in 2.1.4 install.  It's not necessary to run upgrade.php to upgrade 2.1 versions, you can do it in package manager to patch from 2.1.1 > 2.1.2 > 2.1.3 > 2.1.4.
Title: Re: Database connection keeps failing after upgrade
Post by: aceone on March 10, 2024, 07:02:01 AM
I had to copy over the patches manually to do the update, my server is blocked by simplemachines.org.
Title: Re: Database connection keeps failing after upgrade
Post by: aceone on March 10, 2024, 07:32:43 AM
I have installed a new forum in a sub directory with the mysql data from the old forum and it worked without a problem.
But the old forum still says no connection even in the repair tool.
I have copied all files from the new install over the old install excluding Settings.php still the same error.
Title: Re: Database connection keeps failing after upgrade
Post by: Kindred on March 10, 2024, 08:17:19 AM
So, based on that result, it would seem that your settings are incorrect,  regardless of what you THINK they should be....
Title: Re: Database connection keeps failing after upgrade
Post by: aceone on March 10, 2024, 09:06:07 AM
Quote from: Kindred on March 10, 2024, 08:17:19 AMSo, based on that result, it would seem that your settings are incorrect,  regardless of what you THINK they should be....
I made a typo, I meant including not excluding. So the Settings.php is the same file in both directories!

Nevertheless, the repair tool also says that the connection could not be established. The repair tool shows the same password in both directories. All files are exactly the same.

Is there a way to log the connection data including the password that is used?
Title: Re: Database connection keeps failing after upgrade
Post by: Kindred on March 10, 2024, 09:24:46 AM
If the settings are the same, but the directories, paths, and URLs are different then its not going to work either....

But my suggestion is check with your host
Title: Re: Database connection keeps failing after upgrade
Post by: aceone on March 10, 2024, 09:40:50 AM
I have now restarted php fpm and the error has disappeared. Nothing has been changed in the files.
Title: Re: Database connection keeps failing after upgrade
Post by: Kindred on March 10, 2024, 01:40:34 PM
The you are all set
Title: Re: Database connection keeps failing after upgrade
Post by: Doug Heffernan on March 13, 2024, 08:12:12 AM
Quote from: aceone on March 10, 2024, 09:40:50 AMI have now restarted php fpm and the error has disappeared. Nothing has been changed in the files.

I take it that the issue has been solved then. In that case I am marking this as solved. If I read this incorrectly please feel free to unmark it as solved.
Title: Re: Database connection keeps failing after upgrade
Post by: aceone on March 13, 2024, 08:22:52 AM
Quote from: Doug Heffernan on March 13, 2024, 08:12:12 AMI take it that the issue has been solved then. In that case I am marking this as solved. If I read this incorrectly please feel free to unmark it as solved.
Yes, thank you.

I still don't have an explanation for what really happened. I just restarted PHP FPM and suddenly everything worked again. I didn't change anything else.

Hopefully something weird won't happen again.
Title: Re: Database connection keeps failing after upgrade
Post by: Doug Heffernan on March 13, 2024, 08:24:11 AM
Quote from: aceone on March 13, 2024, 08:22:52 AMI still don't have an explanation for what really happened. I just restarted PHP FPM and suddenly everything worked again. I didn't change anything else.

Maybe it was a glitch. If that won't happen again you have nothing to worry about.
 
Title: Re: Database connection keeps failing after upgrade
Post by: Steve on March 13, 2024, 08:58:13 AM
Call the glitch extermination team at 1-888-NOGLITCH ... :P
Title: Re: Database connection keeps failing after upgrade
Post by: Arantor on March 13, 2024, 09:38:41 AM
Depending on config it's possible that PHP-FPM was keeping old versions of files in memory and restarting it forced it to properly reload new files.