Guide
"Error establishing a database connection"
This WordPress error means the website can't reach its database, where its pages are kept. Nothing is lost.
The database is where WordPress keeps every page, post and setting. Most often the web host's database is down or a password no longer matches, and your web host is the one to call.
What you'll see
- Usually
- A plain white page with one line: Error establishing a database connection.
- Sometimes, with more detail
- "This either means that the username and password information in your wp-config.php file is incorrect or that contact with the database server at … could not be established. This could mean your host's database server is down."
Both come from WordPress. Other website software has its own wording for the same problem.
If you're visiting a site
The fault is on the website's side. Nothing on your phone or computer can fix it, and clearing your cache won't help. Try again in an hour, or contact the business another way. It often clears once the host's database is back.
If it's your site
Act straight away: every page is down, admin included, so you can't log in to fix it yourself. The fixes all happen on the hosting account, which is your web host's or web person's job.
- Check your host's status page or support account for an outage, and whether they've emailed you about one. If several of your sites are down at once, it's almost always the host.
- Ask your host whether the database server is running and whether your account has gone over its database size or connection limits.
- Did anything change just before it started: a password change on the hosting account, a move to a new host, a restore from a backup? Say so. The site keeps the database's name, user, password and server in a file called
wp-config.php, and if one of those no longer matches, the connection fails. Your web person or host compares them; don't edit that file yourself. - If it came with other odd signs (new admin users you don't know, strange pages), tell the host you're worried the site was hacked. WordPress lists that as one of the three main causes.
Send this to your web host
Not sure what to say? Copy this into an email, add your website's address, and send it.
Hi, Our website shows "Error establishing a database connection" on every page, including the WordPress login. It started on: [date and time] Just before it started: [password change, move, restore, or "nothing I know of"] Could you check whether the database server is running, whether we've gone over any database limit, and whether the database name, user, password and host in wp-config.php still match the database? Please tell me what you found and what you changed. Thanks
Find out sooner next time
Site health tells you straight away whether your home page loads. Site Watch checks it once a night and emails you when it stops, so a down database at 2 a.m. doesn't wait for a customer to mention it.
PageKiwi Tips
We email you a link first, and nothing is sent until you press Confirm in it. Never sold or shared. What we keep · Past tips