Access denied for user ‘if0_43174693’ to database ‘if0_43174693_atttracker’. I imported the database tables successfully, but my PHP app cannot connect.
Other Information
I created the MySQL database and imported the schema successfully. My PHP app still cannot connect. The database host, username and database name are set in config.php, and I updated the password there after resetting it. Please help me check the database connection/access.
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.
This error means the login got through to the server but was refused for that database. The knowledge base article on common MySQL connection errors says that’s usually one of two things: the database name is wrong, or the password is wrong.
For the name, compare if0_43174693_atttracker in your config.php with what the MySQL Databases section of your control panel shows, character for character. For the password, the database uses your hosting account password. That’s not your client area login password. You can see or change it in the client area by opening the account and looking under MySQL Details.
Which of those did you reset? If it was the client area password, that wouldn’t change the database login. Also, did you paste the new hosting account password into config.php exactly, with no extra space at the end?
Your account’s MySQL host is sql306. Make sure config.php uses the full hostname shown in the control panel, not localhost.
If the name and password both match exactly and it still fails, please post the full error message as your PHP code prints it. The article says that’s what’s needed to look further.
I checked the database name, username, hostname and current MySQL password against the control panel. They match, but the same access denied error remains. I have not included the password for security.
I updated DB_PASS with the hosting account password shown in MySQL Details, saved config.php, and refreshed the website. The same access denied error still appears. Please check the account/database access.
The database name in your error message (and therefore your website config) is:
if0_43174693_atttracker
There is an extra T in there. So the names are different, which is why you get that error.
Please check more carefully next time. Hitting Ctrl+F in your browser and copying the database name from the error message in there is generally a more reliable method than comparing visually. If it doesn’t match the database name in the list, it means it’s different.