{"id":24293,"date":"2022-02-02T14:28:26","date_gmt":"2022-02-02T14:28:26","guid":{"rendered":"https:\/\/1-grid.com\/knowledge\/wordpress-how-to-fix-error-establishing-a-database-connection-error\/"},"modified":"2023-03-06T07:02:19","modified_gmt":"2023-03-06T07:02:19","slug":"wordpress-how-to-fix-error-establishing-a-database-connection-error","status":"publish","type":"ht_kb","link":"https:\/\/1grid.co.za\/knowledge\/wordpress-how-to-fix-error-establishing-a-database-connection-error\/","title":{"rendered":"WordPress: How to fix Error Establishing a Database Connection Error ?"},"content":{"rendered":"<blockquote><p><span style=\"font-family: Helvetica, sans-serif; color: #000000;\" data-identifyelement=\"474\">This article provides you with steps to solve the infamous &#8220;Error connecting to Database&#8221; issue in WordPress. This guide give you the steps on what to check in cPanel but the same things can be checked in other Control panels.<\/span><\/p><\/blockquote>\n<p data-identifyelement=\"475\"><span style=\"font-family: Helvetica,sans-serif;\" data-identifyelement=\"476\">\u00a0<\/span><\/p>\n<p data-identifyelement=\"478\"><span style=\"font-family: Helvetica,sans-serif;\" data-identifyelement=\"479\">\u00a0<\/span><\/p>\n<p data-identifyelement=\"481\"><span style=\"font-family: Helvetica, sans-serif; color: #000000;\" data-identifyelement=\"482\">Are you seeing the \u2018Error establishing a database connection\u2019 notice on your WordPress website? It is a fatal error that makes your WordPress website inaccessible to the users.<\/span><\/p>\n<p data-identifyelement=\"483\"><span style=\"font-family: Helvetica, sans-serif; color: #000000;\" data-identifyelement=\"484\">This error occurs when WordPress is unable to make a connection to the database. A number of things can affect your WordPress database connection which makes it a bit difficult for beginners to troubleshoot.<\/span><\/p>\n<p data-identifyelement=\"485\"><span style=\"font-family: Helvetica, sans-serif; color: #000000;\" data-identifyelement=\"486\">In this article, we will show you how to easily fix the error establishing a database connection in WordPress.<\/span><\/p>\n<p data-identifyelement=\"487\"><span style=\"font-family: Helvetica,sans-serif;\" data-identifyelement=\"488\">\u00a0<\/span><\/p>\n<p data-identifyelement=\"490\"><span style=\"font-family: Helvetica,sans-serif;\" data-identifyelement=\"491\"><img decoding=\"async\" class=\"fr-fic fr-dib fr-bordered fr-shadow aligncenter\" style=\"width: 513px;\" src=\"https:\/\/s3.amazonaws.com\/cdn.freshdesk.com\/data\/helpdesk\/attachments\/production\/33040211770\/original\/FGT_VyWyAJBiLE0-2cpylwzLCScNImmMTw.png?1588590551\" data-attachment=\"[object Object]\" data-id=\"33040211770\" data-identifyelement=\"492\" \/><\/span><\/p>\n<p data-identifyelement=\"493\"><span style=\"font-family: Helvetica,sans-serif;\" data-identifyelement=\"494\">\u00a0<\/span><\/p>\n<h4 data-identifyelement=\"496\"><span style=\"font-family: Helvetica, sans-serif; color: #000000;\" data-identifyelement=\"497\"><span style=\"font-size: 18px;\" data-identifyelement=\"498\"><strong data-identifyelement=\"499\">Have you checked your WordPress Database Credentials?<\/strong><\/span><\/span><\/h4>\n<p data-identifyelement=\"500\"><span style=\"font-family: Helvetica,sans-serif;\" data-identifyelement=\"501\">\u00a0<\/span><\/p>\n<p data-identifyelement=\"503\"><span style=\"font-family: Helvetica, sans-serif; color: #000000;\" data-identifyelement=\"504\">The most common reason for database connection error in WordPress is incorrect database credentials. If you have recently moved your WordPress site to a new host, then this could be the most likely reason.<\/span><\/p>\n<p data-identifyelement=\"505\"><span style=\"font-family: Helvetica, sans-serif; color: #000000;\" data-identifyelement=\"506\">Your WordPress database credentials are stored in the wp-config.php file. It is the WordPress configuration file that contains important WordPress settings including database information.<\/span><\/p>\n<p data-identifyelement=\"507\"><span style=\"font-family: Helvetica, sans-serif; color: #000000;\" data-identifyelement=\"508\">You\u2019ll be looking for the following lines in the wp-config.php file.<\/span><\/p>\n<div style=\"color: #464646; font-family: proxima-nova, Helvetica, Arial, sans-serif; font-size: 15px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration-style: initial; text-decoration-color: initial;\" data-identifyelement=\"509\">\n<div style=\"width: 550px; margin: 1em 0px !important; position: relative !important; overflow: auto hidden !important; font-size: 1em !important; background-color: white !important;\" data-identifyelement=\"510\">\n<table style=\"border-radius: 0px !important; background: none !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: 550px; box-sizing: content-box !important; font-family: Monaco, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: normal !important; font-style: normal !important; font-size: 1em !important; direction: ltr !important; box-shadow: none !important; table-layout: auto !important;\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" data-identifyelement=\"511\">\n<tbody style=\"border-radius: 0px !important; background: none !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; font-family: Monaco, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: normal !important; font-style: normal !important; font-size: 1em !important; direction: ltr !important; box-shadow: none !important;\" data-identifyelement=\"512\">\n<tr style=\"border-radius: 0px !important; background: none !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; font-family: Monaco, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: normal !important; font-style: normal !important; font-size: 1em !important; direction: ltr !important; box-shadow: none !important;\" data-identifyelement=\"513\">\n<td style=\"border-radius: 0px !important; background: none !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; font-family: Monaco, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: normal !important; font-style: normal !important; font-size: 1em !important; direction: ltr !important; box-shadow: none !important; color: #afafaf !important;\" data-identifyelement=\"514\">\n<div style=\"border-radius: 0px !important; background: none white !important; border-width: 0px 3px 0px 0px !important; border-image: initial !important; bottom: auto !important; float: none !important; height: 32px !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px 0.5em 0px 1em !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; font-family: Monaco, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: normal !important; font-style: normal !important; font-size: 1em !important; direction: ltr !important; box-shadow: none !important; white-space: pre-wrap !important; border-color: initial !important #6ce26c !important initial !important initial !important; border-style: initial !important solid !important initial !important initial !important;\" data-identifyelement=\"515\"><span style=\"font-family: Helvetica,sans-serif;\" data-identifyelement=\"516\">1<\/span><\/div>\n<div style=\"border-radius: 0px !important; background: none white !important; border-width: 0px 3px 0px 0px !important; border-image: initial !important; bottom: auto !important; float: none !important; height: 16px !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px 0.5em 0px 1em !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; font-family: Monaco, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: normal !important; font-style: normal !important; font-size: 1em !important; direction: ltr !important; box-shadow: none !important; white-space: pre-wrap !important; border-color: initial !important #6ce26c !important initial !important initial !important; border-style: initial !important solid !important initial !important initial !important;\" data-identifyelement=\"517\"><span style=\"font-family: Helvetica,sans-serif;\" data-identifyelement=\"518\">2<\/span><\/div>\n<div style=\"border-radius: 0px !important; background: none white !important; border-width: 0px 3px 0px 0px !important; border-image: initial !important; bottom: auto !important; float: none !important; height: 16px !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px 0.5em 0px 1em !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; font-family: Monaco, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: normal !important; font-style: normal !important; font-size: 1em !important; direction: ltr !important; box-shadow: none !important; white-space: pre-wrap !important; border-color: initial !important #6ce26c !important initial !important initial !important; border-style: initial !important solid !important initial !important initial !important;\" data-identifyelement=\"519\"><span style=\"font-family: Helvetica,sans-serif;\" data-identifyelement=\"520\">3<\/span><\/div>\n<div style=\"border-radius: 0px !important; background: none white !important; border-width: 0px 3px 0px 0px !important; border-image: initial !important; bottom: auto !important; float: none !important; height: 16px !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px 0.5em 0px 1em !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; font-family: Monaco, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: normal !important; font-style: normal !important; font-size: 1em !important; direction: ltr !important; box-shadow: none !important; white-space: pre-wrap !important; border-color: initial !important #6ce26c !important initial !important initial !important; border-style: initial !important solid !important initial !important initial !important;\" data-identifyelement=\"521\"><span style=\"font-family: Helvetica,sans-serif;\" data-identifyelement=\"522\">4<\/span><\/div>\n<div style=\"border-radius: 0px !important; background: none white !important; border-width: 0px 3px 0px 0px !important; border-image: initial !important; bottom: auto !important; float: none !important; height: 16px !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px 0.5em 0px 1em !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; font-family: Monaco, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: normal !important; font-style: normal !important; font-size: 1em !important; direction: ltr !important; box-shadow: none !important; white-space: pre-wrap !important; border-color: initial !important #6ce26c !important initial !important initial !important; border-style: initial !important solid !important initial !important initial !important;\" data-identifyelement=\"523\"><span style=\"font-family: Helvetica,sans-serif;\" data-identifyelement=\"524\">5<\/span><\/div>\n<div style=\"border-radius: 0px !important; background: none white !important; border-width: 0px 3px 0px 0px !important; border-image: initial !important; bottom: auto !important; float: none !important; height: 16px !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px 0.5em 0px 1em !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; font-family: Monaco, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: normal !important; font-style: normal !important; font-size: 1em !important; direction: ltr !important; box-shadow: none !important; white-space: pre-wrap !important; border-color: initial !important #6ce26c !important initial !important initial !important; border-style: initial !important solid !important initial !important initial !important;\" data-identifyelement=\"525\"><span style=\"font-family: Helvetica,sans-serif;\" data-identifyelement=\"526\">6<\/span><\/div>\n<div style=\"border-radius: 0px !important; background: none white !important; border-width: 0px 3px 0px 0px !important; border-image: initial !important; bottom: auto !important; float: none !important; height: 16px !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px 0.5em 0px 1em !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; font-family: Monaco, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: normal !important; font-style: normal !important; font-size: 1em !important; direction: ltr !important; box-shadow: none !important; white-space: pre-wrap !important; border-color: initial !important #6ce26c !important initial !important initial !important; border-style: initial !important solid !important initial !important initial !important;\" data-identifyelement=\"527\"><span style=\"font-family: Helvetica,sans-serif;\" data-identifyelement=\"528\">7<\/span><\/div>\n<div style=\"border-radius: 0px !important; background: none white !important; border-width: 0px 3px 0px 0px !important; border-image: initial !important; bottom: auto !important; float: none !important; height: 16px !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px 0.5em 0px 1em !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; font-family: Monaco, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: normal !important; font-style: normal !important; font-size: 1em !important; direction: ltr !important; box-shadow: none !important; white-space: pre-wrap !important; border-color: initial !important #6ce26c !important initial !important initial !important; border-style: initial !important solid !important initial !important initial !important;\" data-identifyelement=\"529\"><span style=\"font-family: Helvetica,sans-serif;\" data-identifyelement=\"530\">8<\/span><\/div>\n<div style=\"border-radius: 0px !important; background: none white !important; border-width: 0px 3px 0px 0px !important; border-image: initial !important; bottom: auto !important; float: none !important; height: 16px !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px 0.5em 0px 1em !important; position: static !important; right: auto !important; text-align: right !important; top: auto !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; font-family: Monaco, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: normal !important; font-style: normal !important; font-size: 1em !important; direction: ltr !important; box-shadow: none !important; white-space: pre-wrap !important; border-color: initial !important #6ce26c !important initial !important initial !important; border-style: initial !important solid !important initial !important initial !important;\" data-identifyelement=\"531\"><span style=\"font-family: Helvetica,sans-serif;\" data-identifyelement=\"532\">9<\/span><\/div>\n<\/td>\n<td style=\"border-radius: 0px !important; background: none !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: 516px; box-sizing: content-box !important; font-family: Monaco, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: normal !important; font-style: normal !important; font-size: 1em !important; direction: ltr !important; box-shadow: none !important;\" data-identifyelement=\"533\">\n<div style=\"border-radius: 0px !important; background: none !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: relative !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; font-family: Monaco, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: normal !important; font-style: normal !important; font-size: 1em !important; direction: ltr !important; box-shadow: none !important;\" data-identifyelement=\"534\">\n<div style=\"border-radius: 0px !important; background: none white !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; font-family: Monaco, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: normal !important; font-style: normal !important; font-size: 1em !important; direction: ltr !important; box-shadow: none !important; white-space: pre-wrap !important;\" data-identifyelement=\"535\"><span style=\"font-family: Helvetica,sans-serif;\" data-identifyelement=\"536\"><code style=\"border-radius: 0px !important; background: none !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; font-family: Monaco, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: normal !important; font-style: normal !important; font-size: 1em !important; direction: ltr !important; box-shadow: none !important; display: inline !important; color: #008200 !important;\" data-identifyelement=\"537\">\/\/ ** MySQL settings - You can get this info from your web host ** \/\/<\/code><\/span><\/div>\n<div style=\"border-radius: 0px !important; background: none white !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; font-family: Monaco, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: normal !important; font-style: normal !important; font-size: 1em !important; direction: ltr !important; box-shadow: none !important; white-space: pre-wrap !important;\" data-identifyelement=\"538\"><span style=\"font-family: Helvetica,sans-serif;\" data-identifyelement=\"539\"><code style=\"border-radius: 0px !important; background: none !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; font-family: Monaco, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: normal !important; font-style: normal !important; font-size: 1em !important; direction: ltr !important; box-shadow: none !important; display: inline !important; color: #008200 !important;\" data-identifyelement=\"540\">\/** The name of the database for WordPress *\/<\/code><\/span><\/div>\n<div style=\"border-radius: 0px !important; background: none white !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; font-family: Monaco, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: normal !important; font-style: normal !important; font-size: 1em !important; direction: ltr !important; box-shadow: none !important; white-space: pre-wrap !important;\" data-identifyelement=\"541\"><span style=\"font-family: Helvetica,sans-serif;\" data-identifyelement=\"542\"><code style=\"border-radius: 0px !important; background: none !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; font-family: Monaco, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: normal !important; font-style: normal !important; font-size: 1em !important; direction: ltr !important; box-shadow: none !important; display: inline !important; color: black !important;\" data-identifyelement=\"543\">define(\u00a0<\/code><code style=\"border-radius: 0px !important; background: none !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; font-family: Monaco, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: normal !important; font-style: normal !important; font-size: 1em !important; direction: ltr !important; box-shadow: none !important; display: inline !important; color: blue !important;\" data-identifyelement=\"544\">'DB_NAME'<\/code><code style=\"border-radius: 0px !important; background: none !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; font-family: Monaco, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: normal !important; font-style: normal !important; font-size: 1em !important; direction: ltr !important; box-shadow: none !important; display: inline !important; color: black !important;\" data-identifyelement=\"545\">,\u00a0<\/code><code style=\"border-radius: 0px !important; background: none !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; font-family: Monaco, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: normal !important; font-style: normal !important; font-size: 1em !important; direction: ltr !important; box-shadow: none !important; display: inline !important; color: blue !important;\" data-identifyelement=\"546\">'database_name_here'<\/code> <code style=\"border-radius: 0px !important; background: none !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; font-family: Monaco, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: normal !important; font-style: normal !important; font-size: 1em !important; direction: ltr !important; box-shadow: none !important; display: inline !important; color: black !important;\" data-identifyelement=\"547\">);<\/code><\/span><\/div>\n<div style=\"border-radius: 0px !important; background: none white !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px 1em !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; font-family: Monaco, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: normal !important; font-style: normal !important; font-size: 1em !important; direction: ltr !important; box-shadow: none !important; white-space: pre-wrap !important;\" data-identifyelement=\"548\"><span style=\"font-family: Helvetica,sans-serif;\" data-identifyelement=\"549\"><code style=\"border-radius: 0px !important; background: none !important; border: 0px !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; line-height: 1.1em !important; margin: 0px !important; outline: 0px !important; overflow: visible !important; padding: 0px !important; position: static !important; right: auto !important; text-align: left !important; top: auto !important; vertical-align: baseline !important; width: auto !important; box-sizing: content-box !important; font-family: Monaco, Consolas, 'Bitstream Vera Sans Mono', 'Courier New', Courier, monospace !important; font-weight: normal !important; font-style: normal !important; font-size: 1em !important; direction: ltr !important; box-shadow: none !important; display: inline !important; color: #008200 !important;\" data-identifyelement=\"550\">\/** MySQL database username *\/<\/code><\/span><\/div>\n<div data-identifyelement=\"551\"><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>This article provides you with steps to solve the infamous &#8220;Error connecting to Database&#8221; issue in WordPress. This guide give you the steps on what to check in cPanel but the same things can be checked in other Control panels. \u00a0 \u00a0 Are you seeing the \u2018Error establishing a database&#8230;<\/p>\n","protected":false},"author":21,"comment_status":"closed","ping_status":"closed","template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"ht-kb-category":[27],"ht-kb-tag":[225,270,369,374,413,470,480,1150],"class_list":["post-24293","ht_kb","type-ht_kb","status-publish","format-standard","hentry","ht_kb_category-wordpress","ht_kb_tag-connection-error","ht_kb_tag-database","ht_kb_tag-error","ht_kb_tag-establishing","ht_kb_tag-fix","ht_kb_tag-hosting","ht_kb_tag-how-to","ht_kb_tag-wordpress"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>&quot;Error connecting to Database&quot; issue in WordPress<\/title>\n<meta name=\"description\" content=\"Error connecting to Database issue in WordPress. WordPress: How to fix Error Establishing a Database Connection Error ? 1-grid Knowledge Base\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/1grid.co.za\/knowledge\/wordpress-how-to-fix-error-establishing-a-database-connection-error\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"&quot;Error connecting to Database&quot; issue in WordPress\" \/>\n<meta property=\"og:description\" content=\"Error connecting to Database issue in WordPress. WordPress: How to fix Error Establishing a Database Connection Error ? 1-grid Knowledge Base\" \/>\n<meta property=\"og:url\" content=\"https:\/\/1grid.co.za\/knowledge\/wordpress-how-to-fix-error-establishing-a-database-connection-error\/\" \/>\n<meta property=\"og:site_name\" content=\"1-grid Knowledge Base\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/1grid.co.za\/\" \/>\n<meta property=\"article:modified_time\" content=\"2023-03-06T07:02:19+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/s3.amazonaws.com\/cdn.freshdesk.com\/data\/helpdesk\/attachments\/production\/33040211770\/original\/FGT_VyWyAJBiLE0-2cpylwzLCScNImmMTw.png?1588590551\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:site\" content=\"@1grid_hosting\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/1grid.co.za\/knowledge\/wordpress-how-to-fix-error-establishing-a-database-connection-error\/\",\"url\":\"https:\/\/1grid.co.za\/knowledge\/wordpress-how-to-fix-error-establishing-a-database-connection-error\/\",\"name\":\"\\\"Error connecting to Database\\\" issue in WordPress\",\"isPartOf\":{\"@id\":\"https:\/\/1grid.co.za\/knowledge\/#website\"},\"datePublished\":\"2022-02-02T14:28:26+00:00\",\"dateModified\":\"2023-03-06T07:02:19+00:00\",\"description\":\"Error connecting to Database issue in WordPress. WordPress: How to fix Error Establishing a Database Connection Error ? 1-grid Knowledge Base\",\"breadcrumb\":{\"@id\":\"https:\/\/1grid.co.za\/knowledge\/wordpress-how-to-fix-error-establishing-a-database-connection-error\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/1grid.co.za\/knowledge\/wordpress-how-to-fix-error-establishing-a-database-connection-error\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/1grid.co.za\/knowledge\/wordpress-how-to-fix-error-establishing-a-database-connection-error\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/1grid.co.za\/knowledge\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"WordPress: How to fix Error Establishing a Database Connection Error ?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/1grid.co.za\/knowledge\/#website\",\"url\":\"https:\/\/1grid.co.za\/knowledge\/\",\"name\":\"1-Grid Domain Hosting Knowledge Base\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/1grid.co.za\/knowledge\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/1grid.co.za\/knowledge\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/1grid.co.za\/knowledge\/#organization\",\"name\":\"1-Grid Domain Hosting Knowledge Base\",\"url\":\"https:\/\/1grid.co.za\/knowledge\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/1grid.co.za\/knowledge\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/1grid.co.za\/knowledge\/wp-content\/uploads\/2023\/01\/1-grid-logo-color.svg\",\"contentUrl\":\"https:\/\/1grid.co.za\/knowledge\/wp-content\/uploads\/2023\/01\/1-grid-logo-color.svg\",\"width\":100,\"height\":100,\"caption\":\"1-Grid Domain Hosting Knowledge Base\"},\"image\":{\"@id\":\"https:\/\/1grid.co.za\/knowledge\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/1grid.co.za\/\",\"https:\/\/twitter.com\/1grid_hosting\",\"https:\/\/www.instagram.com\/1grid_hosting\/\",\"https:\/\/za.linkedin.com\/company\/1-grid\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\"Error connecting to Database\" issue in WordPress","description":"Error connecting to Database issue in WordPress. WordPress: How to fix Error Establishing a Database Connection Error ? 1-grid Knowledge Base","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:\/\/1grid.co.za\/knowledge\/wordpress-how-to-fix-error-establishing-a-database-connection-error\/","og_locale":"en_US","og_type":"article","og_title":"\"Error connecting to Database\" issue in WordPress","og_description":"Error connecting to Database issue in WordPress. WordPress: How to fix Error Establishing a Database Connection Error ? 1-grid Knowledge Base","og_url":"https:\/\/1grid.co.za\/knowledge\/wordpress-how-to-fix-error-establishing-a-database-connection-error\/","og_site_name":"1-grid Knowledge Base","article_publisher":"https:\/\/www.facebook.com\/1grid.co.za\/","article_modified_time":"2023-03-06T07:02:19+00:00","og_image":[{"url":"https:\/\/s3.amazonaws.com\/cdn.freshdesk.com\/data\/helpdesk\/attachments\/production\/33040211770\/original\/FGT_VyWyAJBiLE0-2cpylwzLCScNImmMTw.png?1588590551"}],"twitter_card":"summary_large_image","twitter_site":"@1grid_hosting","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/1grid.co.za\/knowledge\/wordpress-how-to-fix-error-establishing-a-database-connection-error\/","url":"https:\/\/1grid.co.za\/knowledge\/wordpress-how-to-fix-error-establishing-a-database-connection-error\/","name":"\"Error connecting to Database\" issue in WordPress","isPartOf":{"@id":"https:\/\/1grid.co.za\/knowledge\/#website"},"datePublished":"2022-02-02T14:28:26+00:00","dateModified":"2023-03-06T07:02:19+00:00","description":"Error connecting to Database issue in WordPress. WordPress: How to fix Error Establishing a Database Connection Error ? 1-grid Knowledge Base","breadcrumb":{"@id":"https:\/\/1grid.co.za\/knowledge\/wordpress-how-to-fix-error-establishing-a-database-connection-error\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/1grid.co.za\/knowledge\/wordpress-how-to-fix-error-establishing-a-database-connection-error\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/1grid.co.za\/knowledge\/wordpress-how-to-fix-error-establishing-a-database-connection-error\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/1grid.co.za\/knowledge\/"},{"@type":"ListItem","position":2,"name":"WordPress: How to fix Error Establishing a Database Connection Error ?"}]},{"@type":"WebSite","@id":"https:\/\/1grid.co.za\/knowledge\/#website","url":"https:\/\/1grid.co.za\/knowledge\/","name":"1-Grid Domain Hosting Knowledge Base","description":"","publisher":{"@id":"https:\/\/1grid.co.za\/knowledge\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/1grid.co.za\/knowledge\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/1grid.co.za\/knowledge\/#organization","name":"1-Grid Domain Hosting Knowledge Base","url":"https:\/\/1grid.co.za\/knowledge\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/1grid.co.za\/knowledge\/#\/schema\/logo\/image\/","url":"https:\/\/1grid.co.za\/knowledge\/wp-content\/uploads\/2023\/01\/1-grid-logo-color.svg","contentUrl":"https:\/\/1grid.co.za\/knowledge\/wp-content\/uploads\/2023\/01\/1-grid-logo-color.svg","width":100,"height":100,"caption":"1-Grid Domain Hosting Knowledge Base"},"image":{"@id":"https:\/\/1grid.co.za\/knowledge\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/1grid.co.za\/","https:\/\/twitter.com\/1grid_hosting","https:\/\/www.instagram.com\/1grid_hosting\/","https:\/\/za.linkedin.com\/company\/1-grid"]}]}},"_links":{"self":[{"href":"https:\/\/1grid.co.za\/knowledge\/wp-json\/wp\/v2\/ht-kb\/24293","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/1grid.co.za\/knowledge\/wp-json\/wp\/v2\/ht-kb"}],"about":[{"href":"https:\/\/1grid.co.za\/knowledge\/wp-json\/wp\/v2\/types\/ht_kb"}],"author":[{"embeddable":true,"href":"https:\/\/1grid.co.za\/knowledge\/wp-json\/wp\/v2\/users\/21"}],"replies":[{"embeddable":true,"href":"https:\/\/1grid.co.za\/knowledge\/wp-json\/wp\/v2\/comments?post=24293"}],"version-history":[{"count":3,"href":"https:\/\/1grid.co.za\/knowledge\/wp-json\/wp\/v2\/ht-kb\/24293\/revisions"}],"predecessor-version":[{"id":31461,"href":"https:\/\/1grid.co.za\/knowledge\/wp-json\/wp\/v2\/ht-kb\/24293\/revisions\/31461"}],"wp:attachment":[{"href":"https:\/\/1grid.co.za\/knowledge\/wp-json\/wp\/v2\/media?parent=24293"}],"wp:term":[{"taxonomy":"ht_kb_category","embeddable":true,"href":"https:\/\/1grid.co.za\/knowledge\/wp-json\/wp\/v2\/ht-kb-category?post=24293"},{"taxonomy":"ht_kb_tag","embeddable":true,"href":"https:\/\/1grid.co.za\/knowledge\/wp-json\/wp\/v2\/ht-kb-tag?post=24293"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}