{"id":3175,"date":"2026-11-24T10:47:09","date_gmt":"2026-11-24T10:47:09","guid":{"rendered":"https:\/\/entri.app\/explore\/?post_type=curriculum&#038;p=3175"},"modified":"2026-11-24T10:47:09","modified_gmt":"2026-11-24T10:47:09","slug":"error-establishing-a-database-connection","status":"publish","type":"curriculum","link":"https:\/\/entri.app\/explore\/digital-marketing\/error-establishing-a-database-connection\/","title":{"rendered":"Error Establishing a Database Connection: How to Fix It"},"content":{"rendered":"<p>The &#8220;Error establishing a database connection&#8221; message means WordPress cannot talk to its database. The most common cause is wrong credentials in wp-config.php. Open that file, compare DB_NAME, DB_USER and DB_PASSWORD with the details in your hosting panel, correct any mismatch, and if all is right, wait a few minutes in case the server is down.<\/p>\n<h2>What does &#8220;Error establishing a database connection&#8221; mean?<\/h2>\n<p>This is the most common WordPress error. It means the WordPress files cannot talk to the database.<\/p>\n<p>Picture the website as a restaurant. The WordPress files are the waiters and the database is the kitchen where all the orders, recipes and stock are kept. When the waiters cannot reach the kitchen, nothing is served, and your visitor sees a plain white page with that sentence.<\/p>\n<h2>Why does this error happen?<\/h2>\n<p>The usual cause is incorrect credentials in the configuration file. Other causes include a temporary server problem, a deleted or damaged database, or a recent move to a new host or domain.<\/p>\n<table>\n<thead>\n<tr>\n<th>What you changed or saw<\/th>\n<th>Likely cause<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>Just installed WordPress<\/td>\n<td>Typo in database name, username or password<\/td>\n<\/tr>\n<tr>\n<td>Just moved to a new host<\/td>\n<td>Old credentials still in wp-config.php<\/td>\n<\/tr>\n<tr>\n<td>Site worked yesterday, nothing changed<\/td>\n<td>Temporary server issue or database overload<\/td>\n<\/tr>\n<tr>\n<td>Error only on \/wp-admin<\/td>\n<td>Damaged database tables<\/td>\n<\/tr>\n<tr>\n<td>Changed the database password in the panel<\/td>\n<td>wp-config.php still has the old password<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>How to fix the error step by step<\/h2>\n<p>Work through these in order. Stop as soon as the site comes back.<\/p>\n<h3>Step 1: Open wp-config.php<\/h3>\n<p>Go to your hosting dashboard, open File Manager, then public_html, and open wp-config.php. Before editing, download a copy so you can undo your changes.<\/p>\n<h3>Step 2: Check the three key lines<\/h3>\n<p>Look for DB_NAME (database name), DB_USER (database username) and DB_PASSWORD (database password).<\/p>\n<h3>Step 3: Cross-check with the hosting panel<\/h3>\n<p>Compare those values with the details in your hosting panel&#8217;s MySQL Databases section. They must match exactly, including capital letters and special characters. Copy and paste instead of retyping.<\/p>\n<p>If you do not remember the password, reset it in the panel, then paste the new one into wp-config.php. The two places must always agree.<\/p>\n<h3>Step 4: Check the database host<\/h3>\n<p>Most hosts use localhost as the database host, but some give a different address. If your host&#8217;s documentation shows a different value, update DB_HOST in wp-config.php.<\/p>\n<h3>Step 5: Confirm the database still exists<\/h3>\n<p>Open phpMyAdmin from your hosting panel and look for your database in the left list. If it is missing or empty, restore it from a backup.<\/p>\n<h3>Step 6: Wait if everything is correct<\/h3>\n<p>If the information is 100 percent correct and it still fails, it may be a temporary server error. Wait 5 to 10 minutes before making further changes.<\/p>\n<p>Changing settings repeatedly while the server recovers makes it harder to know what fixed the problem.<\/p>\n<figure class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-3191\" src=\"https:\/\/wp-cdn.entri.app\/explore\/2026\/11\/digital-marketing-m2-error-establishing-a-database-connection-fix-flow.webp\" alt=\"Flow of six fixes for the error establishing a database connection, in order\" width=\"1200\" height=\"996\" srcset=\"https:\/\/wp-cdn.entri.app\/explore\/2026\/11\/digital-marketing-m2-error-establishing-a-database-connection-fix-flow.webp 1200w, https:\/\/wp-cdn.entri.app\/explore\/2026\/11\/digital-marketing-m2-error-establishing-a-database-connection-fix-flow-300x249.webp 300w, https:\/\/wp-cdn.entri.app\/explore\/2026\/11\/digital-marketing-m2-error-establishing-a-database-connection-fix-flow-1024x850.webp 1024w, https:\/\/wp-cdn.entri.app\/explore\/2026\/11\/digital-marketing-m2-error-establishing-a-database-connection-fix-flow-768x637.webp 768w\" sizes=\"auto, (max-width: 1200px) 100vw, 1200px\"><figcaption class=\"wp-caption-text\">Fixing the database connection error, step by step<\/figcaption><\/figure>\n<h2>Error only on the dashboard? Try repairing the database<\/h2>\n<p>Sometimes the front of the site loads but the admin area shows a message about database tables. WordPress has a built-in repair tool you can switch on by adding one line to wp-config.php, using the setting called WP_ALLOW_REPAIR. Follow the current instructions in the official WordPress documentation, run the repair once, then remove the line, because the repair page does not require a login while it is on.<\/p>\n<h2>How to tell a credentials problem from a server outage<\/h2>\n<p>Two quick checks save time. First, open phpMyAdmin from your hosting panel. If it opens and shows your database, the database is alive and the credentials in wp-config.php are the likely culprit. Second, check whether other sites or tools on the same hosting account are also failing, and look at your host&#8217;s status page. If everything on the account is down, the problem is on the server side and waiting or contacting support is the right move.<\/p>\n<h2>What to tell your host if nothing works<\/h2>\n<p>Contact support and give them three facts: when the error began, what you changed last and the database name. Ask them to check whether the database service is running and whether your account has hit a resource limit. A good host can tell you in minutes.<\/p>\n<h2>How to avoid this error next time<\/h2>\n<ul>\n<li>Save the database name, username and password in a password manager when you create them.<\/li>\n<li>Take a backup before editing wp-config.php or moving the site.<\/li>\n<li>After any migration, update wp-config.php straight away.<\/li>\n<li>Do not rename or delete databases in the panel unless you are sure which site uses them.<\/li>\n<\/ul>\n<h2>A quick troubleshooting card<\/h2>\n<p>Wrong credentials is the cause in most cases, so check wp-config.php first. If that is fine, wait ten minutes. If the dashboard alone fails, use the repair tool. If the database is missing, restore a backup. If you are still stuck, contact your host with the three facts above.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The &#8220;Error establishing a database connection&#8221; message means WordPress cannot talk to its database. The most common cause is wrong credentials in wp-config.php. Open that file, compare DB_NAME, DB_USER and DB_PASSWORD with the details in your hosting panel, correct any mismatch, and if all is right, wait a few minutes in case the server is [&hellip;]<\/p>\n","protected":false},"author":11,"featured_media":0,"template":"","meta":{"_acf_changed":false},"language":[179],"curriculum-category":[185],"custom_linking_tags":[],"class_list":["post-3175","curriculum","type-curriculum","status-publish","hentry","curriculum-category-wordpress-website-building"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Error Establishing a Database Connection: Fix Guide<\/title>\n<meta name=\"description\" content=\"Fix the WordPress error establishing a database connection: check wp-config.php credentials, confirm the database, rule out server issues and prevent it.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/entri.app\/explore\/digital-marketing\/error-establishing-a-database-connection\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Error Establishing a Database Connection: Fix Guide\" \/>\n<meta property=\"og:description\" content=\"Fix the WordPress error establishing a database connection: check wp-config.php credentials, confirm the database, rule out server issues and prevent it.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/entri.app\/explore\/digital-marketing\/error-establishing-a-database-connection\/\" \/>\n<meta property=\"og:site_name\" content=\"Entri Free Materials\" \/>\n<meta property=\"og:image\" content=\"https:\/\/wp-cdn.entri.app\/explore\/2026\/11\/digital-marketing-m2-error-establishing-a-database-connection-fix-flow.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"996\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/entri.app\/explore\/digital-marketing\/error-establishing-a-database-connection\/\",\"url\":\"https:\/\/entri.app\/explore\/digital-marketing\/error-establishing-a-database-connection\/\",\"name\":\"Error Establishing a Database Connection: Fix Guide\",\"isPartOf\":{\"@id\":\"https:\/\/entri.app\/explore\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/entri.app\/explore\/digital-marketing\/error-establishing-a-database-connection\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/entri.app\/explore\/digital-marketing\/error-establishing-a-database-connection\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/wp-cdn.entri.app\/explore\/2026\/11\/digital-marketing-m2-error-establishing-a-database-connection-fix-flow.webp\",\"datePublished\":\"2026-11-24T10:47:09+00:00\",\"description\":\"Fix the WordPress error establishing a database connection: check wp-config.php credentials, confirm the database, rule out server issues and prevent it.\",\"breadcrumb\":{\"@id\":\"https:\/\/entri.app\/explore\/digital-marketing\/error-establishing-a-database-connection\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/entri.app\/explore\/digital-marketing\/error-establishing-a-database-connection\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/entri.app\/explore\/digital-marketing\/error-establishing-a-database-connection\/#primaryimage\",\"url\":\"https:\/\/wp-cdn.entri.app\/explore\/2026\/11\/digital-marketing-m2-error-establishing-a-database-connection-fix-flow.webp\",\"contentUrl\":\"https:\/\/wp-cdn.entri.app\/explore\/2026\/11\/digital-marketing-m2-error-establishing-a-database-connection-fix-flow.webp\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/entri.app\/explore\/digital-marketing\/error-establishing-a-database-connection\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/entri.app\/explore\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Error Establishing a Database Connection: How to Fix It\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/entri.app\/explore\/#website\",\"url\":\"https:\/\/entri.app\/explore\/\",\"name\":\"Entri Free Materials\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/entri.app\/explore\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/entri.app\/explore\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/entri.app\/explore\/#organization\",\"name\":\"Entri Free Materials\",\"url\":\"https:\/\/entri.app\/explore\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/entri.app\/explore\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/wp-cdn.entri.app\/explore\/2025\/03\/logo.svg\",\"contentUrl\":\"https:\/\/wp-cdn.entri.app\/explore\/2025\/03\/logo.svg\",\"caption\":\"Entri Free Materials\"},\"image\":{\"@id\":\"https:\/\/entri.app\/explore\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Error Establishing a Database Connection: Fix Guide","description":"Fix the WordPress error establishing a database connection: check wp-config.php credentials, confirm the database, rule out server issues and prevent it.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/entri.app\/explore\/digital-marketing\/error-establishing-a-database-connection\/","og_locale":"en_US","og_type":"article","og_title":"Error Establishing a Database Connection: Fix Guide","og_description":"Fix the WordPress error establishing a database connection: check wp-config.php credentials, confirm the database, rule out server issues and prevent it.","og_url":"https:\/\/entri.app\/explore\/digital-marketing\/error-establishing-a-database-connection\/","og_site_name":"Entri Free Materials","og_image":[{"width":1200,"height":996,"url":"https:\/\/wp-cdn.entri.app\/explore\/2026\/11\/digital-marketing-m2-error-establishing-a-database-connection-fix-flow.webp","type":"image\/webp"}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/entri.app\/explore\/digital-marketing\/error-establishing-a-database-connection\/","url":"https:\/\/entri.app\/explore\/digital-marketing\/error-establishing-a-database-connection\/","name":"Error Establishing a Database Connection: Fix Guide","isPartOf":{"@id":"https:\/\/entri.app\/explore\/#website"},"primaryImageOfPage":{"@id":"https:\/\/entri.app\/explore\/digital-marketing\/error-establishing-a-database-connection\/#primaryimage"},"image":{"@id":"https:\/\/entri.app\/explore\/digital-marketing\/error-establishing-a-database-connection\/#primaryimage"},"thumbnailUrl":"https:\/\/wp-cdn.entri.app\/explore\/2026\/11\/digital-marketing-m2-error-establishing-a-database-connection-fix-flow.webp","datePublished":"2026-11-24T10:47:09+00:00","description":"Fix the WordPress error establishing a database connection: check wp-config.php credentials, confirm the database, rule out server issues and prevent it.","breadcrumb":{"@id":"https:\/\/entri.app\/explore\/digital-marketing\/error-establishing-a-database-connection\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/entri.app\/explore\/digital-marketing\/error-establishing-a-database-connection\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/entri.app\/explore\/digital-marketing\/error-establishing-a-database-connection\/#primaryimage","url":"https:\/\/wp-cdn.entri.app\/explore\/2026\/11\/digital-marketing-m2-error-establishing-a-database-connection-fix-flow.webp","contentUrl":"https:\/\/wp-cdn.entri.app\/explore\/2026\/11\/digital-marketing-m2-error-establishing-a-database-connection-fix-flow.webp"},{"@type":"BreadcrumbList","@id":"https:\/\/entri.app\/explore\/digital-marketing\/error-establishing-a-database-connection\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/entri.app\/explore\/"},{"@type":"ListItem","position":2,"name":"Error Establishing a Database Connection: How to Fix It"}]},{"@type":"WebSite","@id":"https:\/\/entri.app\/explore\/#website","url":"https:\/\/entri.app\/explore\/","name":"Entri Free Materials","description":"","publisher":{"@id":"https:\/\/entri.app\/explore\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/entri.app\/explore\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/entri.app\/explore\/#organization","name":"Entri Free Materials","url":"https:\/\/entri.app\/explore\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/entri.app\/explore\/#\/schema\/logo\/image\/","url":"https:\/\/wp-cdn.entri.app\/explore\/2025\/03\/logo.svg","contentUrl":"https:\/\/wp-cdn.entri.app\/explore\/2025\/03\/logo.svg","caption":"Entri Free Materials"},"image":{"@id":"https:\/\/entri.app\/explore\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/entri.app\/explore\/wp-json\/wp\/v2\/curriculum\/3175","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/entri.app\/explore\/wp-json\/wp\/v2\/curriculum"}],"about":[{"href":"https:\/\/entri.app\/explore\/wp-json\/wp\/v2\/types\/curriculum"}],"author":[{"embeddable":true,"href":"https:\/\/entri.app\/explore\/wp-json\/wp\/v2\/users\/11"}],"wp:attachment":[{"href":"https:\/\/entri.app\/explore\/wp-json\/wp\/v2\/media?parent=3175"}],"wp:term":[{"taxonomy":"language","embeddable":true,"href":"https:\/\/entri.app\/explore\/wp-json\/wp\/v2\/language?post=3175"},{"taxonomy":"curriculum-category","embeddable":true,"href":"https:\/\/entri.app\/explore\/wp-json\/wp\/v2\/curriculum-category?post=3175"},{"taxonomy":"custom_linking_tags","embeddable":true,"href":"https:\/\/entri.app\/explore\/wp-json\/wp\/v2\/custom_linking_tags?post=3175"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}