{"id":1198,"date":"2026-07-17T07:55:51","date_gmt":"2026-07-17T07:55:51","guid":{"rendered":"https:\/\/www.freethought.uk\/help\/?p=1198"},"modified":"2026-07-17T07:55:52","modified_gmt":"2026-07-17T07:55:52","slug":"how-to-fix-error-establishing-a-database-connection-in-wordpress","status":"publish","type":"post","link":"https:\/\/www.freethought.uk\/help\/how-to-fix-error-establishing-a-database-connection-in-wordpress\/","title":{"rendered":"How to Fix &#8220;Error Establishing a Database Connection&#8221; in WordPress"},"content":{"rendered":"\n<p>If you visit your WordPress site and see a blank white screen displaying <strong>&#8220;Error establishing a database connection&#8221;<\/strong>, don&#8217;t panic! This is one of the most common errors in WordPress, and it usually means WordPress has lost communication with the database where all your posts, pages, and settings are stored.<\/p>\n\n\n\n<p>This article walks you through why this happens, quick checks you can do yourself, and how to contact us if server-side help is needed.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udd0d What Causes This Error?<\/h3>\n\n\n\n<p>WordPress requires four key pieces of information to connect to its database: the <strong>Database Name<\/strong>, <strong>Database Username<\/strong>, <strong>Database Password<\/strong>, and <strong>Database Host<\/strong>. If any of these don&#8217;t match, or if the server is under temporary stress, the connection fails.<\/p>\n\n\n\n<p>Common culprits include:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Misconfigured credentials in your <code>wp-config.php<\/code> file (often after a migration or password update).<\/li>\n\n\n\n<li>Database corruption or missing tables.<\/li>\n\n\n\n<li>Reaching account disk space or database quota limits.<\/li>\n\n\n\n<li>Temporary server-side maintenance or heavy traffic spikes.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udee0\ufe0f Self-Service Diagnostic Steps<\/h3>\n\n\n\n<p>Before reaching out to support, here are three quick checks you can perform:<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Step 1: Check Your Storage Quota<\/h4>\n\n\n\n<p>If your hosting account is 100% full, the database engine may stop responding.<\/p>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li>Log in to <strong>cPanel<\/strong>.<\/li>\n\n\n\n<li>Check the <strong>Disk Usage<\/strong> gauge on the right-hand sidebar.<\/li>\n\n\n\n<li>If your account is full, remove unnecessary backup files or temp files to free up space.<\/li>\n<\/ol>\n\n\n\n<h4 class=\"wp-block-heading\">Step 2: Verify Your <code>wp-config.php<\/code> Credentials<\/h4>\n\n\n\n<p>If you recently updated a database password in cPanel, WordPress won&#8217;t know unless you update it in your configuration file too:<\/p>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li>In cPanel, open <strong>File Manager<\/strong> and go to <code>public_html<\/code>.<\/li>\n\n\n\n<li>Right-click the <code>wp-config.php<\/code> file and select <strong>Edit<\/strong>.<\/li>\n\n\n\n<li>Look for the following lines: <code>define('DB_NAME', 'your_db_name'); define('DB_USER', 'your_db_user'); define('DB_PASSWORD', 'your_db_password'); define('DB_HOST', 'localhost');<\/code><\/li>\n\n\n\n<li>Cross-check these values with your actual database details under <strong>cPanel &gt; Manage My Databases<\/strong>. Ensure the username is assigned to the database with <strong>All Privileges<\/strong>.<\/li>\n<\/ol>\n\n\n\n<h4 class=\"wp-block-heading\">Step 3: Try Repairing the Database<\/h4>\n\n\n\n<p>If your database became corrupted during an update:<\/p>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li>In cPanel, go to <strong>Manage My Databases<\/strong>.<\/li>\n\n\n\n<li>Under <strong>Modify Databases<\/strong>, select your site&#8217;s database and click <strong>Check Database<\/strong>.<\/li>\n\n\n\n<li>If errors are reported, click <strong>Repair Database<\/strong>.<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\ude80 When to Escalate to Support<\/h3>\n\n\n\n<p>If your credentials are correct, your disk space is fine, and the error persists, it may require server-side investigation by an engineer.<\/p>\n\n\n\n<p><strong>How to open a ticket for faster resolution:<\/strong> When submitting a support ticket at <strong>my.cloudabove.com<\/strong>, please include:<\/p>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li><strong>Your Website URL<\/strong> (e.g., <code>yourdomain.com<\/code>).<\/li>\n\n\n\n<li><strong>The Exact Error Message<\/strong> you are seeing.<\/li>\n\n\n\n<li><strong>Diagnostic Steps Taken<\/strong> (e.g., <em>&#8220;I verified wp-config credentials match cPanel&#8221;<\/em>).<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>If you visit your WordPress site and see a blank white screen displaying &#8220;Error establishing a database connection&#8221;, don&#8217;t panic! This is one of the most common errors in WordPress, and it usually means WordPress has lost communication with the database where all your posts, pages, and settings are stored.&hellip;<\/p>\n","protected":false},"author":9,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,26],"tags":[],"class_list":["post-1198","post","type-post","status-publish","format-standard","hentry","category-cpanel","category-wordpress"],"_links":{"self":[{"href":"https:\/\/www.freethought.uk\/help\/wp-json\/wp\/v2\/posts\/1198","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.freethought.uk\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.freethought.uk\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.freethought.uk\/help\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/www.freethought.uk\/help\/wp-json\/wp\/v2\/comments?post=1198"}],"version-history":[{"count":1,"href":"https:\/\/www.freethought.uk\/help\/wp-json\/wp\/v2\/posts\/1198\/revisions"}],"predecessor-version":[{"id":1214,"href":"https:\/\/www.freethought.uk\/help\/wp-json\/wp\/v2\/posts\/1198\/revisions\/1214"}],"wp:attachment":[{"href":"https:\/\/www.freethought.uk\/help\/wp-json\/wp\/v2\/media?parent=1198"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.freethought.uk\/help\/wp-json\/wp\/v2\/categories?post=1198"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.freethought.uk\/help\/wp-json\/wp\/v2\/tags?post=1198"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}