MySQL Connection Error - Please Activate Remote Access

Hello,

I created my hosting account 4 days ago (January 21, 2026) but I’m still unable to connect to MySQL from PHP scripts.

Account Details:

  • Username: if0_40960845
  • Domain: bismillah.free.nf
  • Database: if0_40960845_invoices
  • MySQL Hostname: sql207.infinityfree.com

Error Message:
SQLSTATE[HY000] [2002] No such file or directory

The database works fine in phpMyAdmin, but PHP scripts cannot connect remotely.
Could you please help activate MySQL remote access for my account?

Thank you!

A database error saying “No such file or directory” can mean only one thing: it means you’re using localhost as the database hostname.

This can be because you’re specifically passing that, or because you’re not passing a database hostname to the MySQL connector (MySQLi or PDO) at all, and it is using localhost as the default.

The value to use is probably sql207.infinityfree.com (it looks like what a database hostname should look like). So please check your code and make sure that this setting is also passed to the database connector.

10 Likes

Thank you! I fixed the localhost issue. The db.php now has sql207.infinityfree.com.

However, I’m now getting a different error:
SQLSTATE[HY000] [1045] Access denied for user ‘if0_40960845’@‘192.168.0.53’ (using password: YES)

The hostname is correct, credentials are correct (they work in phpMyAdmin), but PHP scripts are getting “Access denied” when trying to connect remotely.

Could you please enable remote MySQL access for my account if0_40960845?

Thank you!

It’s not about “remote MySQL access”. Yes, it’s a domain, it’s not “localhost”, but everything is still happening within the hosting.

This error suggest that either your password or database name is wrong. I don’t know how did you “verify the password is correct in phpMyAdmin”, because our phpMyAdmin straight up doesn’t have password login.

8 Likes

Thank you for checking!

I’ve verified the credentials are exactly correct (see screenshots):

  • Username: if0_40960845
  • Password: 1DuaRUs3jeiJXKS
  • Database: if0_40960845_invoices
  • Hostname: sql207.infinityfree.com
  • Port: 3306

The exact same credentials in my db.php file on the server.

My account was created on January 21, 2026 (6 days ago). I’ve read that InfinityFree restricts MySQL access for new accounts as an anti-spam measure.

Could this be the issue? Is there a way to manually enable MySQL access for my account since the credentials are verified correct?

Thank you for your help!

Please change your database password immediately! This is a public forum which is indexed on Google, so by sharing it here you’ve made it to where everyone can see it. Though considering the situation, resetting the database password is a logical next step anyway.

I don’t know where you read that, but SQL access is not disabled for new accounts. And if it was, it’s unlikely that there would be a way to “manually” enable it earlier than intended.

There is nothing about the error message that suggests you don’t have access to the database server, especially since you can use it from phpMyAdmin. As long as the connection is coming from inside your website (and not elsewhere) there isn’t anything from preventing you from using it.

6 Likes

And if you use this password anywhere else change it there too.

5 Likes

I have two points of good news, thanks to one thing: the password you are using in your configuration is not correct. It’s very similar, but not identical, so it’s not accepted. This also means that your account is probably safe, but I still reset your hosting account password just to be sure.

Please copy the current account password from the client area and put that in your website configuration file. I strongly recommend copy-pasting, not typing it by hand, or it’s very easy to make a mistake that may be difficult to spot.

But please do make sure that you keep your passwords safe from now on. This is a publicly accessible forum, you should really not share sensitive details here.

10 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.