XF 2.2 An unexpected database error occurred. Please try again later.

vinnymickey

Active member
I have done nothing and came up with this error when trying to reach forum any ideas?

An unexpected database error occurred. Please try again later.

view source:
<html><head></head><body>An unexpected database error occurred. Please try again later.
<!-- Access denied for user 'campruf1_petsit'@'localhost' (using password: YES) --></body></html>


Here's Link To Forum
 
Check with your host, it’s likely a security issue with mod_sec or something similar.
Thanks just read the sticky too and sent a ticket to host...

PS: I had two sites on this host and recently moved Xenforo to the other site on same host. (Combined two sites into one). Everything was working great after the move for weeks. Today they deleted old site which xenforo was at and this is when new site which was working for weeks triggered the error. Just some more history that may help track down what happened.
 
Last edited:
Having issues with database! I have another host migrating my site to their server and Forum is still having same issue. Is it even possible when I transferred forum to new domain it was using database from another cpanel? Therefore when old host deleted the site i didnt need anymore the database was also gone. Is that even possible. Would the database move into cpanel when i moved the forum folder weeks ago?
 
If it was a cPanel to cPanel transfer on a new host, everything should have migrated.
Who are you hosting with? Have you looked at the page source to see what (if anything) it says?
 
If it was a cPanel to cPanel transfer on a new host, everything should have migrated.
Who are you hosting with? Have you looked at the page source to see what (if anything) it says?
All I did was download the subdiretcory folder and uploaded it and it was working for weeks. When they deleted old site I got this error. Now new migrating host says he cant find the database and gettimg same error.

view source:
An unexpected database error occurred. Please try again later.
<!-- Access denied for user 'campruf1_petsit'@'localhost' (using password: YES) -->


PS this error was before migration! I started migration because many said it was a server issue blocking etc MOD_sec or some security
 
I replied to your ticket this morning.

The error in the first post is due to the mysql database details on the server no longer matching what is in the src/config.php file.
 
I replied to your ticket this morning.

The error in the first post is due to the mysql database details on the server no longer matching what is in the src/config.php file.
I'm guessing somehow XEnforo was using database from another cpanel :/ I didnt even think that was possible...Hence when second site was deleted so was databases :(
 
XF can't connect to a database on a different host/server unless there is some very specific configuration set up (which is very unlikely).

You or your host have made changes to the database log in credentials on the server where XF is installed.
 
XF can't connect to a database on a different host/server unless there is some very specific configuration set up (which is very unlikely).

You or your host have made changes to the database log in credentials on the server where XF is installed.
I kinda figured that cant be possible when I moved Xen it was working for weeks. What I dont understand is why cant new host doing the migration find the database :/ very frustrating..
 
The DB is NOT stored in your XF directory... it's in a totally separate location on a server that odds are you CANNOT gain access to if you are on shared hosting. If you are on a VPS or dedicated server you can. So the XF files that were copied over had nothing (other than contents of one file) to do with it.

What happened in that a new mySQL account was created for the DB that was pulled from the old site... you simply copied your XF directory over, and did NOT update the mySQL credentials in your config.php to reflect the new server/hosting instance of mySQL. And honestly, a cPanel->cPanel transfer should have done that.
Once more, what "new" hosting provider are you using?
 
The DB is NOT stored in your XF directory... it's in a totally separate location on a server that odds are you CANNOT gain access to if you are on shared hosting. If you are on a VPS or dedicated server you can. So the XF files that were copied over had nothing (other than contents of one file) to do with it.

What happened in that a new mySQL account was created for the DB that was pulled from the old site... you simply copied your XF directory over, and did NOT update the mySQL credentials in your config.php to reflect the new server/hosting instance of mySQL. And honestly, a cPanel->cPanel transfer should have done that.
Once more, what "new" hosting provider are you using?
Knownhost is new host but I’m confused on why it was working for weeks…
 
Just for my own knowledge if I wanted to get the old site to work before the move so we can delete the old site (three) do I upload the database and overwrite? Still very confused how the two sites are working off same database :(
 
Mayhap I've imbibed in to much holiday cheer... but I really now don't quite understand what's going on.
I thought you had ALREADY moved to the new site and migrated over? Is the old host still running the old site? It should have really been brought offline right prior to the move so no new content could be added to it which would be lost if the same data is going to the new site... because if you have the old site running and then the new site set up with the old sites DB... there's no "easy" merge. One or the other.
Now, if you set the new site up as a totally NEW site with NO users nor content, you might be able to merge the old site (and all it's content) into it... but I have a feeling from the questions you've had that is not exactly what was going on, as it's rather detailed in what needs to be done.
You can have 15 thousand sites running off the "same database" if each database is hosted with a different provider and the file contents for the site(s) are present, or you can even have multiple sites reading/writing to the SAME database, and those sites CAN be in remote locations... but again, that takes a little more work that most think.
I think you STILL think that the DB is a "physical file" that gets copied with your XF file structure... it's not. It IS a physical file on the server... but generally it's in /var/lib/mysql, a location that on a shared hosting you will have NO access to.
You simply do a DB dump of the data into a different physical file, then you can take that DB dump and import it into another instance of mySQL on another server.
 
Mayhap I've imbibed in to much holiday cheer... but I really now don't quite understand what's going on.
I thought you had ALREADY moved to the new site and migrated over? Is the old host still running the old site? It should have really been brought offline right prior to the move so no new content could be added to it which would be lost if the same data is going to the new site... because if you have the old site running and then the new site set up with the old sites DB... there's no "easy" merge. One or the other.
Now, if you set the new site up as a totally NEW site with NO users nor content, you might be able to merge the old site (and all it's content) into it... but I have a feeling from the questions you've had that is not exactly what was going on, as it's rather detailed in what needs to be done.
You can have 15 thousand sites running off the "same database" if each database is hosted with a different provider and the file contents for the site(s) are present, or you can even have multiple sites reading/writing to the SAME database, and those sites CAN be in remote locations... but again, that takes a little more work that most think.
I think you STILL think that the DB is a "physical file" that gets copied with your XF file structure... it's not. It IS a physical file on the server... but generally it's in /var/lib/mysql, a location that on a shared hosting you will have NO access to.
You simply do a DB dump of the data into a different physical file, then you can take that DB dump and import it into another instance of mySQL on another server.
I’ll admit I’m a bit confused but sorting it out slowly.

I am in the process of moving and actually stuck because I can’t get my host file to solve IP to my domain to test it out to move along.

So I figure why not repair old site so old host can take down site number three that was merged into one main site (the one being moved) . This way old site will be intact until move is complete. I understand easy merge but fortunately my forum is super slow so I don’t have to worry about losing any post on switch.

I just put a lot of time into this site and don’t want to lose anything and hate to see it broken :)

Thanks for your input…

Now back to this host file nonsense…
 
Ok now testing on new host and when I run a file check I get this 🤦‍♂️ about to throw in the towel on this…..
 

Attachments

  • AE2CCF60-ACA6-4910-91C9-61591E245273.webp
    AE2CCF60-ACA6-4910-91C9-61591E245273.webp
    251 KB · Views: 16
Top Bottom