Error connecting to database with Wordpress in XAMPP

Hi everyone, I’m epiz_27213770 and I have a problem trying to set un WordPress locally with XAMPP and connecting it to database here in the free hosting service.

I’ve already created the database from cPanel and configured wp-config.php manually to connect to the database (db-name, user-pass, user-pass and db-host). (Yes, I configured WP previously for other projects so you can asume I wrote the config rigth :stuck_out_tongue: )

But when I try to load http://localhost/WP-projects/wordpress/ I get error message: Error establishing a database connection
With DEBUG in true I get this:

Warning : mysqli_real_connect(): (HY000/2002): Se produjo un error durante el intento de conexión ya que la parte conectada no respondió adecuadamente tras un periodo de tiempo, o bien se produjo un error en la conexión establecida ya que el host conectado no ha podido responder.

It basically says that the host could not respond (witch is sql211.epizy.com).
This is werid because I could go to phpmyadmind and create a sample table so the database is up and runing…

I’ve tried downloading WordPress again and creating a new database several times, but still getting the same error message. I guess the error may be something related with the connetion between XAMPP on localhost and InfinityFree DataBase host, but couldn’t find anything on the web or other related posts.

Thanks for you help in advance!

This is because InfinityFree doesnt allow remote database connection. What it means is only the domain/s registered in your account can access the database. Any other external connections requesting your database will be blocked.

Thus, to sum it up, you can’t connect the database in your local server no matter how you try.

Why not host a local mysql server in your computer instead and there connect it to WP then after you are ready (in production phase), just migrate your local WP to InfinityFree?

I suggest these:

8 Likes

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