WordPress database connection error after migration

Website URL

https://textilesflow-test.freepage.cc

Error Message

Error establishing a database connection

Other Information

I am migrating a WordPress site to this test subdomain. The SQL import into a separate database completed successfully, and the plugins, themes and uploads folders were transferred successfully.

I checked DB_NAME, DB_USER and DB_HOST against the hosting panel and recopied the MySQL password. WP_CACHE is false, and there is no wp-content/db.php. The error persists.

How can I safely identify the exact MySQL connection error? Please advise which non-sensitive diagnostic details you need.

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.

The most useful thing is the exact error text from MySQL. WordPress hides it behind “Error establishing a database connection”, but you can get it by temporarily putting a small PHP file in htdocs, for example dbtest.php:

<?php
mysqli_report(MYSQLI_REPORT_OFF);
$c = mysqli_connect('YOUR_DB_HOST', 'YOUR_DB_USER', 'YOUR_DB_PASSWORD', 'YOUR_DB_NAME');
echo $c ? 'Connected' : mysqli_connect_errno() . ': ' . mysqli_connect_error();

Fill in the same values as wp-config.php, open the file in your browser, then delete it. The output is either “Connected” or an error number and message. That message is what anybody can work from, and it doesn’t contain the password. If the page shows Warning: mysqli_real_connect(), that line is fine to post too.

Please post that output, plus the DB_NAME, DB_USER and DB_HOST lines from wp-config.php with the password left out. I can then compare them against your account’s databases character by character. A one-character difference in the database name is easy to miss when copying, and the account has more than one database, so it’s worth checking which one the config points at.

If the output turns out to be max_user_connections, this article explains that error:

I wouldn’t assume that’s your problem until the test shows it.

No, that’s not possible.

Because the password in your configuration file is not your account password, and contains characters that are not even allowed to be in your account password.

So please copy your hosting account password from the MySQL Databases page in the members area and put that in the configuration file.