Error Establishing a Database Connection or Too Many Connections: What to Check
"Error establishing a database connection" means your website's code is running but cannot reach the database where its pages, products, users and settings are stored. "Too many connections" is a narrower version of the same problem: the database is running, but every available connection slot is already in use. In both cases your content is usually still intact; the site simply cannot get to it right now.
The first message is the wording WordPress uses, so it is most often seen on WordPress sites, but any database-backed website or web application can fail the same way. Entrant Technologies builds such sites through its WordPress development service. This page covers what you can check yourself in about 10 minutes and what to leave alone.
What does "Error establishing a database connection" mean?
It means the web server tried to open a connection to the database and was refused or got no reply. A website has two parts: the code that builds each page, and the database that holds the content. The first part is working; the second is unreachable.
WordPress's own documentation says the message "means that there is a problem with the connection to your database" and lists three groups of causes: incorrect database details in the site's configuration file (wp-config.php), problems at the web host, and a compromised site. Under host problems it names two cases: the database "has met its quota and has been shut down" or "the server is down". See the WordPress Common Errors page (last updated August 28, 2025; checked October 6, 2026).
Underneath, the database software reports something more specific. The MySQL manual explains that a "Can't connect" error normally means no MySQL server is running on that machine, or that the wrong address or port is being used to reach it.
What does "too many connections" mean?
It means the database is alive but full. According to the MySQL manual, when clients see this error "all available connections are in use by other clients". The ceiling is a setting called max_connections. MariaDB, a MySQL-compatible database used by many hosts, documents a default of 151 simultaneous connections (checked October 6, 2026), and a hosting plan may set its own limit.
The limit is reached for one of two reasons. Either far more visitors than usual arrived at once (a sale, an email campaign, bot traffic), or something on the site is slow, so each visitor holds a connection for longer and they pile up. This error often comes and goes.
Why would a website suddenly lose its database?
Almost always because something changed on the hosting side or in the site's configuration, not because the data vanished. The usual causes are:
The database server is down or restarting
The host may be doing maintenance or the server may have crashed. On shared hosting this affects many customers at once.
The hosting account is suspended or out of space
An unpaid invoice, an expired card or an exceeded storage quota can lead a host to switch the database off. A full disk has a similar effect: the MySQL manual says that when the disk fills up the database checks once every minute for free space before it continues writing.
The database password or address changed
If someone reset the database password, or the site or account was moved to a new server, the site may still hold the old details and be turned away.
A failed update or a damaged table
An update that stopped halfway, or a table damaged by a crash, can make the database refuse requests. This is the cause that most needs a professional.
What can I safely check in about 10 minutes?
You can narrow the cause down without touching the site itself. Every step below is read-only: you are looking, not changing.
- Note the exact message and the time. Take a screenshot of the error page, including the address bar.
- Try another device and network. Open the site on your phone using mobile data. If it fails there too, the problem is on the server.
- Open your host's status page. An open incident about database or MySQL services probably explains everything, and the fix is theirs to make.
- Check billing in the hosting control panel. Look for an overdue invoice, an expired card or a suspension notice, and check the hosting account's email inbox, including spam.
- Check disk usage in the control panel. Storage at or near 100 percent of your quota is a strong lead.
- Test other sites on the same hosting. If they all fail, suspect the server or the account. If only one fails, suspect that site's own settings.
- Ask what changed. Did anyone update a plugin, change a password, switch plans or launch a campaign just before it started?
If steps 3 to 5 point to the host, open a support ticket, quote the exact message and ask whether the database service for your account is running.
What should I not do?
Do not run repair tools, restore a backup or edit configuration files yourself, because each of those can turn a short outage into lost data. Restoring last week's backup overwrites every order, enquiry and edit made since then, and it will not help if the real cause is an unpaid invoice.
WordPress includes a database repair script, and many online guides tell owners to switch it on. The WordPress documentation notes that when it is enabled, "a user does not need to be logged in to access the functionality", and that it "should only be enabled if needed and disabled once the issue is solved". Leave that decision to a developer who has confirmed a table is actually damaged.
Also avoid reloading the page over and over; with a connection limit problem, extra requests make it worse. Do not change the database password "to see if it helps", and do not delete files to free space.
When should I call a developer, and what should I send?
Call a developer if the host says its services are healthy, your account is paid and has free space, and the error is still there or keeps returning. At that point the cause is inside the site: wrong credentials, slow queries, a failed update or a damaged table. Have this ready:
- The screenshot, the exact wording, the time it started, and whether it is constant or comes and goes.
- What you found on the status page, billing page and disk usage screen.
- Anything that changed recently: updates, password resets, a hosting move, a campaign.
- The hosting company and plan name, and any reply from their support.
- Whether you have backups, where they are kept and the date of the latest one.
Do not send passwords by email. Agree on a secure way to share access first.
How do I stop it happening again?
Remove the avoidable causes and make sure you hear about the rest before your customers do. Put hosting on automatic renewal, make sure renewal emails reach a mailbox someone reads, and keep an eye on disk usage. Set up an uptime monitor that loads a real page, so a database failure triggers an alert.
If "too many connections" appears whenever traffic rises, the site has outgrown its plan or has slow database queries that need fixing; raising the limit alone only delays the next failure. Finally, confirm that backups run automatically, are stored away from the web server and have been test-restored. Our guide to backups and disaster recovery for business applications covers what to ask for.
Quick answers
Is my website data lost if I see "Error establishing a database connection"?
Usually not. The message means the website cannot reach its database, not that the database has been erased. In most cases the content reappears once the connection is restored.
What causes "Error establishing a database connection"?
WordPress's documentation lists incorrect database details in the wp-config.php file, problems at the web host (a database shut down for exceeding its quota, or a server that is down) and a compromised site. On a site that was working an hour ago, rule out a host outage, a suspended account and a changed password first.
Will "too many connections" fix itself?
It can clear on its own once traffic drops and connections are released. If it keeps coming back, the site needs a larger hosting plan or a developer to find the slow queries holding connections open.
Should I restore a backup to fix a database connection error?
No, not as a first step. A restore overwrites everything added since the backup was taken and does nothing if the cause is a host outage, an unpaid invoice, a full disk or a changed password.
Who should I contact first, my host or a developer?
Contact the host first if its status page shows an incident, your account shows a billing or storage problem, or every site on the account is down. Contact a developer if the host confirms the database service is running and the error remains.
Conclusion
A database connection error describes a broken link between two working parts, and the cause is usually found on a status page, a billing page or a disk usage meter. Check those, write down what you see, and do not repair or restore anything yourself.
Entrant Technologies builds websites, web applications, mobile apps and custom software. If you have no developer available, contact us with the details listed above and we will take a look.