MySQL error 1044 – database access denied

Website URL

https://barbergo.infinityfree.io/

Error Message

SQLSTATE[HY000] [1044] Access denied for user ‘if0_43147904’@‘192.168.%’ to database ‘if0_43147904_barbergo’

Other Information

My database exists and contains six tables. I have verified the database name, MySQL username, host, and password in my hosting panel. However, the connection test from my PHP application still returns error 1044.

Please check whether the MySQL user has the correct permissions to access this database and whether there is any issue with the database configuration on the hosting server.

Website: https://barbergo.infinityfree.io/

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.

It sounds like the database name in your PHP code doesn’t exactly match the one on your account. Could you paste the database name exactly as it appears under MySQL Databases in your control panel, and the database name your code is using?

The article on common MySQL errors says this error means the login worked, but the user has no access to the database name it was given. It says a wrong database name is the usual cause. A wrong password is the other possibility it lists. The name has to be the full one, including the if0_43147904_ prefix, and one wrong character is enough to trigger it.

Having six tables in the database doesn’t rule this out. A name that’s slightly off, or one belonging to a different database, gets this error in the same way.

The article is here:

If the names match exactly, please also tell me which database hostname your code uses. Your account is on the sql303 server, so it should be the full hostname shown in your control panel for that server, not localhost. A person would need to look at the account if all of that checks out.

Hello, thank you for your reply.

I have checked the values in my hosting control panel and my PHP configuration. They match exactly:

  • Database name in the control panel: if0_43147904_barbergo

  • Database name in config.php: if0_43147904_barbergo

  • MySQL hostname in the control panel: sql303.infinityfree.com

  • MySQL hostname in config.php: sql303.infinityfree.com

  • MySQL username: if0_43147904

My database exists and contains six tables. I also tested the connection directly using PDO, but the same error persists:

SQLSTATE[HY000] [1044] Access denied for user 'if0_43147904'@'192.168.%' to database 'if0_43147904_barbergo'

Could you please check whether there is an issue with the database permissions or hosting account configuration?

Thank you for your help.

Chances are that you are not using the correct password. Database permissions are not the issue in most of the cases.

No. They don’t and it isn’t. This is the actual database name shown:

It says barberOgo. There is an extra letter in there.

Please check more carefully next time. Actually check if they match, not just if they look similar.