Welcome to the InfinityFree community forum! Good to have you here.
Most people answering here are volunteers. They’re often the fastest source of help. Admin (the only staff member) checks in about once a day for issues on our end.
Volunteers can’t see your account or website. Share what you actually see, like error messages and what happens when you try something. That’s more useful than your theory of what’s wrong.
AI tools often get InfinityFree wrong. If a volunteer’s advice differs from what an AI told you, please try the volunteer’s suggestion first.
Solving an issue is a joint effort. Try the suggestions you get and report back what happened.
Beep boop, I’m a bot! I dug through the forum to get you started. I sometimes get things wrong though, so do with this what you will until a human has a look.
Your hostname and database name match what your account has: sql301 is the MySQL host for if0_43334832, and if0_43334832_db_business is spelled exactly like the database in the control panel. So those two details aren’t the problem. I couldn’t find a source on whether port 3306 is the right one or whether any other hostname is required, so I can’t confirm either.
Another user reported the same Connection refused error a few weeks ago, but theirs came and went for about a minute around the same time each day. It might be the same thing, so I need to know whether yours fails on every request or only at certain times.
If it fails every time, can you post the lines of PHP that build the connection? That means the DSN and the new PDO(...) call, with the password removed. I’d like to check that the code uses the same host, database name and username you listed above.
The code looks fine at first glance. But so does your website: I checked it and it seems to be working fine. Where exactly on your website is that code located?
I hope you don’t mind, but I had a hunch and I very briefly added a var_dump(app_config()); line to the deployment check code (it’s gone now), and it confirmed my hunch: your website configuration is not being read correctly. This is what it said for the database configuratin:
Of course, this database host is wrong, so the database connection fails. And since the website server has no MySQL server running on it, you get a Connection Refused error.
So this is a website code bug, not a hosting issue or a database problem. Please try updating your website code so it uses the correct database configuration.