{"id":3968,"date":"2026-07-23T09:26:04","date_gmt":"2026-07-23T09:26:04","guid":{"rendered":"https:\/\/disoh.com\/support\/how-to-fix-error-establishing-a-database-connection-in-wordpress\/"},"modified":"2026-07-23T09:26:04","modified_gmt":"2026-07-23T09:26:04","password":"","slug":"how-to-fix-error-establishing-a-database-connection-in-wordpress","status":"publish","type":"docs","link":"https:\/\/disoh.com\/sv\/support\/how-to-fix-error-establishing-a-database-connection-in-wordpress\/","title":{"rendered":"How to Fix Error Establishing a Database Connection in WordPress"},"content":{"rendered":"<p>&#8220;Error establishing a database connection&#8221; means WordPress cannot reach its database. It is a common error with a few clear causes. This guide explains how to diagnose and fix it.<\/p>\n<h2>What the error means<\/h2>\n<p>WordPress stores your content in a MySQL database. If it cannot connect, usually because of wrong credentials, a database issue, or a server hiccup, it shows this error instead of your site.<\/p>\n<h2>Step 1: Check your database credentials<\/h2>\n<p>Open <em>wp-config.php<\/em> and confirm the database name, username, password, and host (usually localhost) match what is in your hosting control panel. A recent migration or password change is the most common cause of a mismatch.<\/p>\n<h2>Step 2: Confirm the database user&#8217;s access<\/h2>\n<ul>\n<li>In your control panel, make sure the database user is assigned to the database.<\/li>\n<li>Confirm the user has the right privileges.<\/li>\n<\/ul>\n<h2>Step 3: Check the database itself<\/h2>\n<p>Open phpMyAdmin and confirm the database exists and has tables. Occasionally a database can need repair, which WordPress can attempt if you enable repair mode.<\/p>\n<h2>Step 4: Rule out a server issue<\/h2>\n<p>If credentials are correct and it still fails, the database server may be temporarily overloaded or down. Wait a few minutes and retry, and check whether other sites on the account are affected.<\/p>\n<h2>Troubleshooting summary<\/h2>\n<ul>\n<li><strong>After a migration:<\/strong> fix the credentials in wp-config.php.<\/li>\n<li><strong>Suddenly, no changes:<\/strong> likely a temporary server issue; retry shortly.<\/li>\n<li><strong>Corrupt database:<\/strong> try WordPress repair mode.<\/li>\n<\/ul>\n<h2>Need help?<\/h2>\n<p>If the error persists, our support team can check the database and server for you over live chat.<\/p>","protected":false},"excerpt":{"rendered":"<p>&#8220;Error establishing a database connection&#8221; means WordPress cannot reach its database. It is a common error with a few clear causes. This guide explains how to diagnose and fix it. What the error means WordPress stores your content in a MySQL database. If it cannot connect, usually because of wrong credentials, a database issue, or [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"footnotes":""},"doc_category":[32],"doc_tag":[],"class_list":["post-3968","docs","type-docs","status-publish","hentry","doc_category-wordpress"],"year_month":"2026-09","word_count":250,"total_views":"160","reactions":{"happy":"0","normal":"0","sad":"0"},"author_info":{"name":"Jorn","author_nicename":"jorn","author_url":"https:\/\/disoh.com\/sv\/author\/jorn\/"},"doc_category_info":[{"term_name":"WordPress","term_url":"https:\/\/disoh.com\/sv\/docs-category\/wordpress\/"}],"doc_tag_info":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Fix Error Establishing a Database Connection in WordPress &#8211; Disoh<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/disoh.com\/sv\/support\/how-to-fix-error-establishing-a-database-connection-in-wordpress\/\" \/>\n<meta property=\"og:locale\" content=\"sv_SE\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Fix Error Establishing a Database Connection in WordPress &#8211; Disoh\" \/>\n<meta property=\"og:description\" content=\"&#8220;Error establishing a database connection&#8221; means WordPress cannot reach its database. It is a common error with a few clear causes. This guide explains how to diagnose and fix it. What the error means WordPress stores your content in a MySQL database. If it cannot connect, usually because of wrong credentials, a database issue, or [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/disoh.com\/sv\/support\/how-to-fix-error-establishing-a-database-connection-in-wordpress\/\" \/>\n<meta property=\"og:site_name\" content=\"Disoh\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/disohhosting\" \/>\n<meta property=\"og:image\" content=\"https:\/\/disoh.com\/wp-content\/uploads\/2025\/07\/disoh_about.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1536\" \/>\n\t<meta property=\"og:image:height\" content=\"1024\" \/>\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=\"Ber\u00e4knad l\u00e4stid\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minut\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/disoh.com\\\/no\\\/support\\\/how-to-fix-error-establishing-a-database-connection-in-wordpress\\\/\",\"url\":\"https:\\\/\\\/disoh.com\\\/no\\\/support\\\/how-to-fix-error-establishing-a-database-connection-in-wordpress\\\/\",\"name\":\"How to Fix Error Establishing a Database Connection in WordPress &#8211; Disoh\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/disoh.com\\\/fi\\\/#website\"},\"datePublished\":\"2026-07-23T09:26:04+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/disoh.com\\\/no\\\/support\\\/how-to-fix-error-establishing-a-database-connection-in-wordpress\\\/#breadcrumb\"},\"inLanguage\":\"sv-SE\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/disoh.com\\\/no\\\/support\\\/how-to-fix-error-establishing-a-database-connection-in-wordpress\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/disoh.com\\\/no\\\/support\\\/how-to-fix-error-establishing-a-database-connection-in-wordpress\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/disoh.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Fix Error Establishing a Database Connection in WordPress\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/disoh.com\\\/fi\\\/#website\",\"url\":\"https:\\\/\\\/disoh.com\\\/fi\\\/\",\"name\":\"Disoh\",\"description\":\"Digital Solutions Hosting\",\"publisher\":{\"@id\":\"https:\\\/\\\/disoh.com\\\/fi\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/disoh.com\\\/fi\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"sv-SE\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/disoh.com\\\/fi\\\/#organization\",\"name\":\"Disoh LLC\",\"url\":\"https:\\\/\\\/disoh.com\\\/fi\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"sv-SE\",\"@id\":\"https:\\\/\\\/disoh.com\\\/fi\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/disoh.com\\\/wp-content\\\/uploads\\\/2025\\\/06\\\/favicon_1.svg\",\"contentUrl\":\"https:\\\/\\\/disoh.com\\\/wp-content\\\/uploads\\\/2025\\\/06\\\/favicon_1.svg\",\"width\":615,\"height\":615,\"caption\":\"Disoh LLC\"},\"image\":{\"@id\":\"https:\\\/\\\/disoh.com\\\/fi\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/disohhosting\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Fix Error Establishing a Database Connection in WordPress &#8211; Disoh","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:\/\/disoh.com\/sv\/support\/how-to-fix-error-establishing-a-database-connection-in-wordpress\/","og_locale":"sv_SE","og_type":"article","og_title":"How to Fix Error Establishing a Database Connection in WordPress &#8211; Disoh","og_description":"&#8220;Error establishing a database connection&#8221; means WordPress cannot reach its database. It is a common error with a few clear causes. This guide explains how to diagnose and fix it. What the error means WordPress stores your content in a MySQL database. If it cannot connect, usually because of wrong credentials, a database issue, or [&hellip;]","og_url":"https:\/\/disoh.com\/sv\/support\/how-to-fix-error-establishing-a-database-connection-in-wordpress\/","og_site_name":"Disoh","article_publisher":"https:\/\/www.facebook.com\/disohhosting","og_image":[{"width":1536,"height":1024,"url":"https:\/\/disoh.com\/wp-content\/uploads\/2025\/07\/disoh_about.webp","type":"image\/webp"}],"twitter_card":"summary_large_image","twitter_misc":{"Ber\u00e4knad l\u00e4stid":"1 minut"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/disoh.com\/no\/support\/how-to-fix-error-establishing-a-database-connection-in-wordpress\/","url":"https:\/\/disoh.com\/no\/support\/how-to-fix-error-establishing-a-database-connection-in-wordpress\/","name":"How to Fix Error Establishing a Database Connection in WordPress &#8211; Disoh","isPartOf":{"@id":"https:\/\/disoh.com\/fi\/#website"},"datePublished":"2026-07-23T09:26:04+00:00","breadcrumb":{"@id":"https:\/\/disoh.com\/no\/support\/how-to-fix-error-establishing-a-database-connection-in-wordpress\/#breadcrumb"},"inLanguage":"sv-SE","potentialAction":[{"@type":"ReadAction","target":["https:\/\/disoh.com\/no\/support\/how-to-fix-error-establishing-a-database-connection-in-wordpress\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/disoh.com\/no\/support\/how-to-fix-error-establishing-a-database-connection-in-wordpress\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/disoh.com\/"},{"@type":"ListItem","position":2,"name":"How to Fix Error Establishing a Database Connection in WordPress"}]},{"@type":"WebSite","@id":"https:\/\/disoh.com\/fi\/#website","url":"https:\/\/disoh.com\/fi\/","name":"Disoh","description":"Digitala l\u00f6sningar \u2013 webbhotell","publisher":{"@id":"https:\/\/disoh.com\/fi\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/disoh.com\/fi\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"sv-SE"},{"@type":"Organization","@id":"https:\/\/disoh.com\/fi\/#organization","name":"Disoh LLC","url":"https:\/\/disoh.com\/fi\/","logo":{"@type":"ImageObject","inLanguage":"sv-SE","@id":"https:\/\/disoh.com\/fi\/#\/schema\/logo\/image\/","url":"https:\/\/disoh.com\/wp-content\/uploads\/2025\/06\/favicon_1.svg","contentUrl":"https:\/\/disoh.com\/wp-content\/uploads\/2025\/06\/favicon_1.svg","width":615,"height":615,"caption":"Disoh LLC"},"image":{"@id":"https:\/\/disoh.com\/fi\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/disohhosting"]}]}},"knowledge_base_info":[],"knowledge_base_slug":[],"_links":{"self":[{"href":"https:\/\/disoh.com\/sv\/wp-json\/wp\/v2\/docs\/3968","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/disoh.com\/sv\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/disoh.com\/sv\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/disoh.com\/sv\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/disoh.com\/sv\/wp-json\/wp\/v2\/comments?post=3968"}],"version-history":[{"count":0,"href":"https:\/\/disoh.com\/sv\/wp-json\/wp\/v2\/docs\/3968\/revisions"}],"wp:attachment":[{"href":"https:\/\/disoh.com\/sv\/wp-json\/wp\/v2\/media?parent=3968"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/disoh.com\/sv\/wp-json\/wp\/v2\/doc_category?post=3968"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/disoh.com\/sv\/wp-json\/wp\/v2\/doc_tag?post=3968"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}