Error: cannot connect to the database
Your site shows one line of text about a database connection and nothing else. Unpleasant to see, but usually quickly solved: the cause is nearly always in the same four things.
1. The credentials no longer match
Your CMS keeps the database name, user and password in a configuration file. If the password was changed — after a move or a security measure, for instance — that change has to be in that file too. This is by far the most common cause.
2. Something changed just now
Think back to the last action before the error: a move, a restore from backup, a changed PHP version or a plugin update. Whatever changed last is your best clue.
3. The database is full or overloaded
If your plan is full, the database can no longer write and the connection drops. Check your free space; if it is gone, clear up first. A spike in traffic can also cause too many simultaneous connections for a while — the site then comes back on its own.
4. The database is damaged
Rarer, and usually the result of an interrupted write. This is where trying it yourself stops: get in touch with your domain name and the time it was still working.
What to do straight away
- Do not work on the site further and install nothing new. Every extra change makes it harder to determine what went wrong.
- Check whether your admin area is unreachable too. If that works, it points at something other than the database connection itself.
- See whether your free space is still sufficient.
- Contact support with three details: your domain name, what changed last, and the time the site was still working.
Other error messages and what they mean are in error codes 403, 404 and 500.
Does it behave differently than described above, or are you stuck anyway? Get in touch with your domain name or customer number at hand and we will take a look with you.
Contact support