# WordPress database connection error after migration

**URL:** <https://forum.infinityfree.com/t/wordpress-database-connection-error-after-migration/121770>\
**Category:** Hosting Support\
**Created:** [November 2, 2026, 2:31pm UTC](https://forum.infinityfree.com/t/wordpress-database-connection-error-after-migration/121770 "2026-11-02T14:31:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![TextilesFlowHelp](https://forum.infinityfree.com/letter_avatar/textilesflowhelp/32/6_449c533f586939b6e5f246632a46421f.png) [@TextilesFlowHelp](https://forum.infinityfree.com/u/TextilesFlowHelp)\
**Post date:** [November 2, 2026, 2:31pm UTC](https://forum.infinityfree.com/t/wordpress-database-connection-error-after-migration/121770/1 "2026-11-02T14:31:21Z")

</div>

### Website URL

[https://textilesflow-test.freepage.cc](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.

---

<div class="post-metadata">

**Author:** ![system](https://infinityfree-forum-uploads.s3.dualstack.eu-central-1.amazonaws.com/original/3X/b/0/b024fd3fa88bae093c9576e55c2c94e33f890206.svg) [@system](https://forum.infinityfree.com/u/system)\
**Post date:** [November 2, 2026, 2:31pm UTC](https://forum.infinityfree.com/t/wordpress-database-connection-error-after-migration/121770/2 "2026-11-02T14:31:21Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Lemni](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/lemni/32/68303_2.png) [@Lemni](https://forum.infinityfree.com/u/Lemni)\
**Post date:** [November 2, 2026, 2:31pm UTC](https://forum.infinityfree.com/t/wordpress-database-connection-error-after-migration/121770/3 "2026-11-02T14:31:43Z")

</div>

_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
<?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:

> [@WordPress: User \[...\] already has more than 'max\_user\_connections' active connections](https://forum.infinityfree.com/docs?topic=86252):
>
> If you have a WordPress site, you may see intermittent “Error establishing a database connection” messages. When debugging this, you can may see the following error message: User xxx\_xxxxxxxx already has more than ‘max\_user\_connections’ active connections This article explains what this means and how to fix it. What does this error mean In order to prevent a single website from overloading a database server, there is a limit on the number of database connections that can be created for a si…

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

---

<div class="post-metadata">

**Author:** ![Admin](https://forum.infinityfree.com/user_avatar/forum.infinityfree.com/admin/32/36437_2.png) [@Admin](https://forum.infinityfree.com/u/Admin)\
**Post date:** [November 2, 2026, 3:35pm UTC](https://forum.infinityfree.com/t/wordpress-database-connection-error-after-migration/121770/4 "2026-11-02T15:35:50Z")

</div>

> [@TextilesFlowHelp](#):
>
> recopied the MySQL password

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.

---

<div class="post-metadata">

**Author:** ![system](https://infinityfree-forum-uploads.s3.dualstack.eu-central-1.amazonaws.com/original/3X/b/0/b024fd3fa88bae093c9576e55c2c94e33f890206.svg) [@system](https://forum.infinityfree.com/u/system)\
**Post date:** [November 9, 2026, 3:36pm UTC](https://forum.infinityfree.com/t/wordpress-database-connection-error-after-migration/121770/5 "2026-11-09T15:36:46Z")

</div>

Closed on November 9, 2026, 3:36pm UTC

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