![](https://sqlkitty.com/wp-content/uploads/2024/02/image-1024x295.png)
I had no idea what to do, so I Googled it
Found this link below and tried the repair thing as the settings were in the config file as expected:
https://dba.stackexchange.com/questions/269450/warning-mysqli-real-connect-hy000-2002-connection-refused-in-var-www-htm
But then suddenly, my config file contents became my homepage contents! Including my database name, username, and password. I had to get rid of that fast!
I found there was a file wp-config.php and a wp-config-old.php. The old one looked way cleaner and nicer, so I figured since my site was pretty messed up already, I swapped them, and the site was totally fine again.
If there hadn’t been an old config file that I could switch to, I would’ve renamed the wp-config anyway to prevent it from displaying on my public homepage — and then worked to figure out another solution.
This reminded me to back up my WordPress regularly. There is an import and export function.
![](https://sqlkitty.com/wp-content/uploads/2024/02/image-2.png)
This way, you will have an XML file for the future in case your WordPress blows up. I went ahead and created a totally free WordPress site to restore it and make sure it works. You can do that here — https://www.infinityfree.com/