{"id":8154,"date":"2019-08-29T09:15:22","date_gmt":"2019-08-29T09:15:22","guid":{"rendered":"https:\/\/www.milesweb.in\/hosting-faqs\/?p=8154"},"modified":"2026-03-21T17:59:27","modified_gmt":"2026-03-21T12:29:27","slug":"fixing-error-establishing-a-database-connection-in-wordpress","status":"publish","type":"post","link":"https:\/\/www.milesweb.in\/hosting-faqs\/fixing-error-establishing-a-database-connection-in-wordpress\/","title":{"rendered":"Fixing Error Establishing a Database Connection in WordPress"},"content":{"rendered":"<p>Have you ever encountered with a blank white screen page having a simple brisk message: <strong>\u201cError Establishing a Database Connection\u201d<\/strong>?<\/p>\n<p>If yes, you might have tried refreshing many times, but were unable to access the website.<\/p>\n<p>It\u2019s a fact that for each minute your website goes down, you lose the chance to generate leads, have conversions and enjoy sales.<\/p>\n<p>No doubt, the situation is serious, but calm your nerves down and don\u2019t panic! This guide will help you to better understand and learn some practical approach on fixing the error establishing a database connection in WordPress.<\/p>\n<p><strong>Points Covered:<\/strong><\/p>\n<ul>\n<li><a href=\"#1WPDBError\"><strong>The Reason for Occurrence of WordPress Database Error<\/strong><\/a><\/li>\n<li><a href=\"#2WPDBError\"><strong>Verifying Error Establishing a Database Connection<\/strong><\/a><\/li>\n<li><a href=\"#3WPDBError\"><strong>Check Database Login Credentials in wp-config<\/strong><\/a><\/li>\n<li><a href=\"#4WPDBError\"><strong>Reset Username and Password<\/strong><\/a><\/li>\n<li><a href=\"#5WPDBError\"><strong>Database Host Value<\/strong><\/a><\/li>\n<\/ul>\n<h3 id=\"1WPDBError\">The Reason for Occurrence of WordPress Database Error<\/h3>\n<p>First, let\u2019s check what this error message actually means.<\/p>\n<p>MySQL is a language that is used by your database. Your website is dependent on a server-side language called PHP. Whenever someone enters your website URL into the browser, WordPress uses PHP to recover all the information related to the page from the database and sends it to the visitor\u2019s browser.<\/p>\n<p><a href=\"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2019\/08\/WordPress-Website-Flow-min.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-8172\" src=\"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2019\/08\/WordPress-Website-Flow-min.jpg\" alt=\"\" width=\"636\" height=\"334\" srcset=\"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2019\/08\/WordPress-Website-Flow-min.jpg 636w, https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2019\/08\/WordPress-Website-Flow-min-300x158.jpg 300w\" sizes=\"auto, (max-width: 636px) 100vw, 636px\" \/><\/a><\/p>\n<p>You get the error establishing a database connection because this MySQL-PHP connection is cut-off for some reason, which needs to be investigated.<\/p>\n<p>Check the following scenarios that may cause this error:<\/p>\n<ul>\n<li>Check if you have changed your login credentials (username and password). In case you haven\u2019t, those might have been changed somehow.<\/li>\n<li>Did you install a poorly coded plugin? A poorly coded plugin might corrupt your database.<\/li>\n<li>Is your website experiencing a heavy traffic spike, which is beyond your server\u2019s capacity?<\/li>\n<li>Check if your WordPress web hosting is at fault and the database is not functioning due to some problem at their end.<\/li>\n<\/ul>\n<p>Prior to attempting to fix the error establishing a database connection in WordPress, I recommend you to take a backup! You can take the backup in the following ways:<\/p>\n<ul>\n<li>Download all web files from FTP (SFTP). This can be done by logging into your hosting account.<\/li>\n<li>Export MySQL database using the Export function.<\/li>\n<li>Alternatively, you can use the UpdraftPlus plugin to backup your data.<\/li>\n<\/ul>\n<h3 id=\"2WPDBError\">Verifying Error Establishing a Database Connection<\/h3>\n<p>Did you get the same error when you try to browse the website URL (front-end), and when you try to log in to \/wp-admin\/ (<strong>back-end<\/strong>)? If you are getting the error establishing a database connection, navigate to the next step.<\/p>\n<p>But, if you get the below error when trying to login to \/wp-admin\/, it means your database has been corrupted:<\/p>\n<p><strong>\u201cOne or more database tables are unavailable. The database may need to be repaired\u201d<\/strong><\/p>\n<p>To resolve this, go to your root WordPress file directory, locate your wp-config.php file. This will enable<strong> WordPress\u2019 built-in repair feature.<\/strong><\/p>\n<p><strong><em>Launch Filezilla \u2014\u2013&gt; (WordPress install folder) \u2014\u2013&gt; public_html<\/em><\/strong><\/p>\n<p>Right-click on the <strong>wp-config.php<\/strong> file and select a code editor, such as <strong>Sublime Text Editor<\/strong> to open the file.<\/p>\n<p><a href=\"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2019\/08\/wp-config-WordPress-min.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-8173\" src=\"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2019\/08\/wp-config-WordPress-min.png\" alt=\"\" width=\"316\" height=\"327\" srcset=\"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2019\/08\/wp-config-WordPress-min.png 316w, https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2019\/08\/wp-config-WordPress-min-290x300.png 290w\" sizes=\"auto, (max-width: 316px) 100vw, 316px\" \/><\/a><\/p>\n<p>Once the <strong>wp-config.php<\/strong> file is opened, add the below line at the bottom of the file:<\/p>\n<pre class=\"lang:default decode:true \">define('WP_ALLOW_REPAIR', true);<\/pre>\n<p>Now go to:<\/p>\n<pre class=\"lang:default decode:true \">example.com\/wp-admin\/maint\/repair.php<\/pre>\n<p>(Replace \u201cexample.com\u201d with your actual URL)<\/p>\n<p><a href=\"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2019\/08\/Repair-WordPress-Database-1-min.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-8174\" src=\"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2019\/08\/Repair-WordPress-Database-1-min.png\" alt=\"\" width=\"1001\" height=\"519\" srcset=\"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2019\/08\/Repair-WordPress-Database-1-min.png 1001w, https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2019\/08\/Repair-WordPress-Database-1-min-300x156.png 300w, https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2019\/08\/Repair-WordPress-Database-1-min-768x398.png 768w\" sizes=\"auto, (max-width: 1001px) 100vw, 1001px\" \/><\/a><\/p>\n<p>You will get the above-mentioned options displayed. Here select the <strong>\u201cRepair and Optimize Database\u201d<\/strong> option. Though it might take more time, it is a highly comprehensive attempt to resolve the issue.<\/p>\n<p>To access this repair page there is no need to log in, so it creates a security issue. Instantly, after the repair and optimization have been done, <strong>remove the line<\/strong> of code you added to the wp-config.php file.<\/p>\n<p>Check if this method fixed WordPress error establishing a database connection. If it has, congratulations! If not, keep on reading to find another fix for the error.<\/p>\n<h3 id=\"3WPDBError\">Check Database Login Credentials in wp-config<\/h3>\n<p>If the above solution hasn\u2019t worked for you, then the possible cause of your problem is your database settings.<\/p>\n<p>As said above, your database login settings might get disturbed, if you change other details of your user information or database. This happens if the system <strong>doesn&#8217;t properly update your wp-config.php file<\/strong>.<\/p>\n<p>wp-config.php is the most important file of WordPress. It contains all the database information.<\/p>\n<p>To open this file, go to:<\/p>\n<p><strong><em>Launch Filezilla \u2014\u2013&gt;(WordPress install folder) \u2014\u2013&gt; public_html<\/em><\/strong><\/p>\n<p>Right-click on the <strong>wp-config.php<\/strong> file and select a code editor such as Sublime to open the file.<\/p>\n<p>After you have opened the wp-config.php file, you will see four key variables defined in the code, which are required for connecting to the database.<\/p>\n<p>These are database name, database username, database password, and database host that is localhost in most of the cases (there may also be an IP address in place of localhost).<\/p>\n<pre class=\"lang:default decode:true \">\/\/ ** MySQL settings - You can get this info from your web host ** \/\/\r\n\r\n\/** The name of the database for WordPress *\/\r\ndefine( 'DB_NAME', 'database_name_here' );\r\n\r\n\/** MySQL database username *\/\r\ndefine( 'DB_USER', 'username_here' );\r\n\r\n\/** MySQL database password *\/\r\ndefine( 'DB_PASSWORD', 'password_here' );\r\n\r\n\/** MySQL hostname *\/\r\ndefine( 'DB_HOST', 'localhost' );<\/pre>\n<p>Make sure you note down these values. Now, login to your hosting account and select the <strong>\u201cApplications\u201d<\/strong> tab. Go into your WordPress application, from the <strong>\u201cAccess Details\u201d<\/strong> tab, click <strong>\u201cLaunch Database Manager\u201d<\/strong>.<\/p>\n<p><a href=\"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2019\/08\/Application-Access-Details-Cloudways-1024x508-min.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-8175\" src=\"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2019\/08\/Application-Access-Details-Cloudways-1024x508-min-1024x508.png\" alt=\"\" width=\"1024\" height=\"508\" srcset=\"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2019\/08\/Application-Access-Details-Cloudways-1024x508-min.png 1024w, https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2019\/08\/Application-Access-Details-Cloudways-1024x508-min-300x149.png 300w, https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2019\/08\/Application-Access-Details-Cloudways-1024x508-min-768x381.png 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/p>\n<p>You will see the table named <strong>wp_options<\/strong>, click on it. It will show your website name, URL and other settings. This shows whether you have the correct information in your <strong>wp-config.php<\/strong> file or not.<\/p>\n<p><a href=\"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2019\/08\/WordPress-Database-wp_options-min.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-8176\" src=\"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2019\/08\/WordPress-Database-wp_options-min.png\" alt=\"\" width=\"955\" height=\"588\" srcset=\"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2019\/08\/WordPress-Database-wp_options-min.png 955w, https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2019\/08\/WordPress-Database-wp_options-min-300x185.png 300w, https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2019\/08\/WordPress-Database-wp_options-min-768x473.png 768w\" sizes=\"auto, (max-width: 955px) 100vw, 955px\" \/><\/a><\/p>\n<p>If the <strong>\u2018siteurl\u2019<\/strong>, and<strong> \u2018home\u2019<\/strong> field information don\u2019t match, then <strong>edit wp-config.ph<\/strong>p file and insert the<strong> same values<\/strong> as in the wp_options table.<\/p>\n<h3 id=\"4WPDBError\">Reset Username and Password<\/h3>\n<p>Check if the username and password in your wp-config.php file match those in <strong>phpMyAdmin<\/strong>. In this example, it\u2019s <strong>\u201cMySQL Access\u201d<\/strong>.<\/p>\n<p><a href=\"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2019\/08\/WordPress-Database-Details-Cloudways-1024x497-min.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-large wp-image-8177\" src=\"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2019\/08\/WordPress-Database-Details-Cloudways-1024x497-min-1024x497.png\" alt=\"\" width=\"1024\" height=\"497\" srcset=\"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2019\/08\/WordPress-Database-Details-Cloudways-1024x497-min.png 1024w, https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2019\/08\/WordPress-Database-Details-Cloudways-1024x497-min-300x146.png 300w, https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2019\/08\/WordPress-Database-Details-Cloudways-1024x497-min-768x373.png 768w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/p>\n<p>If the username and password are different, open your wp-config.php file and edit it to include the values from the <strong>\u201cMySQL Access\u201d<\/strong> panel.<\/p>\n<p>That\u2019s it! If you would have tried this via cPanel, you\u2019d have needed to take a lot of efforts.<\/p>\n<h3 id=\"5WPDBError\">Database Host Value<\/h3>\n<p>The last important value in WordPress wp-config.php file is <strong>DB_HOST<\/strong>. Most web hosting providers require this value to be localhost, which is the value in the file by default.<\/p>\n<p>If you\u2019ve performed all the above solutions, and still facing the error establishing a database connection in WordPress, then contact your web hosting provider and ask them to provide you with the DB_HOST value and enter it into the wp-config.php file.<\/p>\n<p>Hope that you found this guide helpful and that you were able to solve the WordPress error establishing a database connection issue.<\/p>\n<p>Have you found any other way to get rid of this problem? Let us know in the comments section below and mention what worked and what didn\u2019t work for you. This will help others who are facing the same issue as you.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Have you ever encountered with a blank white screen page having a simple brisk message: \u201cError Establishing a Database Connection\u201d? If yes, you might have tried refreshing many times, but were unable to access the website. It\u2019s a fact that for each minute your website goes down, you lose the chance to generate leads, have [&hellip;]<\/p>\n","protected":false},"author":16,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3087],"tags":[986,78,987],"class_list":["post-8154","post","type-post","status-publish","format-standard","placeholder-for-hentry","category-troubleshooting-and-errors-wordpress","tag-common-errors-in-wordpress","tag-wordpress-2","tag-wordpress-database"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Fixing Error Establishing a Database Connection in WordPress<\/title>\n<meta name=\"description\" content=\"The article displays the steps that help in fixing the error establishing a database connection in WordPress.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.milesweb.in\/hosting-faqs\/fixing-error-establishing-a-database-connection-in-wordpress\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Fixing Error Establishing a Database Connection in WordPress\" \/>\n<meta property=\"og:description\" content=\"The article displays the steps that help in fixing the error establishing a database connection in WordPress.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.milesweb.in\/hosting-faqs\/fixing-error-establishing-a-database-connection-in-wordpress\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Hosting FAQs by MilesWeb\" \/>\n<meta property=\"article:published_time\" content=\"2019-08-29T09:15:22+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-03-21T12:29:27+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2019\/08\/WordPress-Website-Flow-min.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"636\" \/>\n\t<meta property=\"og:image:height\" content=\"334\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Pallavi Godse\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Pallavi Godse\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/fixing-error-establishing-a-database-connection-in-wordpress\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/fixing-error-establishing-a-database-connection-in-wordpress\/\"},\"author\":{\"name\":\"Pallavi Godse\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/7e3952607fa9eb4e82fea9f7cad9c945\"},\"headline\":\"Fixing Error Establishing a Database Connection in WordPress\",\"datePublished\":\"2019-08-29T09:15:22+00:00\",\"dateModified\":\"2026-03-21T12:29:27+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/fixing-error-establishing-a-database-connection-in-wordpress\/\"},\"wordCount\":1101,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/fixing-error-establishing-a-database-connection-in-wordpress\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2019\/08\/WordPress-Website-Flow-min.jpg\",\"keywords\":[\"Common Errors in WordPress\",\"WordPress\",\"WordPress Database\"],\"articleSection\":[\"Troubleshooting &amp; Errors\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.milesweb.in\/hosting-faqs\/fixing-error-establishing-a-database-connection-in-wordpress\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/fixing-error-establishing-a-database-connection-in-wordpress\/\",\"url\":\"https:\/\/www.milesweb.in\/hosting-faqs\/fixing-error-establishing-a-database-connection-in-wordpress\/\",\"name\":\"Fixing Error Establishing a Database Connection in WordPress\",\"isPartOf\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/fixing-error-establishing-a-database-connection-in-wordpress\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/fixing-error-establishing-a-database-connection-in-wordpress\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2019\/08\/WordPress-Website-Flow-min.jpg\",\"datePublished\":\"2019-08-29T09:15:22+00:00\",\"dateModified\":\"2026-03-21T12:29:27+00:00\",\"author\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/7e3952607fa9eb4e82fea9f7cad9c945\"},\"description\":\"The article displays the steps that help in fixing the error establishing a database connection in WordPress.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/fixing-error-establishing-a-database-connection-in-wordpress\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.milesweb.in\/hosting-faqs\/fixing-error-establishing-a-database-connection-in-wordpress\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/fixing-error-establishing-a-database-connection-in-wordpress\/#primaryimage\",\"url\":\"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2019\/08\/WordPress-Website-Flow-min.jpg\",\"contentUrl\":\"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2019\/08\/WordPress-Website-Flow-min.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/fixing-error-establishing-a-database-connection-in-wordpress\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.milesweb.in\/hosting-faqs\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Fixing Error Establishing a Database Connection in WordPress\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#website\",\"url\":\"https:\/\/www.milesweb.in\/hosting-faqs\/\",\"name\":\"Web Hosting FAQs by MilesWeb\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.milesweb.in\/hosting-faqs\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/7e3952607fa9eb4e82fea9f7cad9c945\",\"name\":\"Pallavi Godse\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/3602d0ac1ab89332aea8205dcf474af4ff4eb319cfd584544038908cd5e4c966?s=96&d=blank&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/3602d0ac1ab89332aea8205dcf474af4ff4eb319cfd584544038908cd5e4c966?s=96&d=blank&r=g\",\"caption\":\"Pallavi Godse\"},\"description\":\"Pallavi is a Digital Marketing Executive at MilesWeb and has an experience of over 4 years in content development. She is interested in writing engaging content on business, technology, web hosting and other topics related to information technology.\",\"sameAs\":[\"https:\/\/www.milesweb.in\"],\"url\":\"https:\/\/www.milesweb.in\/hosting-faqs\/author\/pallavi\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Fixing Error Establishing a Database Connection in WordPress","description":"The article displays the steps that help in fixing the error establishing a database connection in WordPress.","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:\/\/www.milesweb.in\/hosting-faqs\/fixing-error-establishing-a-database-connection-in-wordpress\/","og_locale":"en_US","og_type":"article","og_title":"Fixing Error Establishing a Database Connection in WordPress","og_description":"The article displays the steps that help in fixing the error establishing a database connection in WordPress.","og_url":"https:\/\/www.milesweb.in\/hosting-faqs\/fixing-error-establishing-a-database-connection-in-wordpress\/","og_site_name":"Web Hosting FAQs by MilesWeb","article_published_time":"2019-08-29T09:15:22+00:00","article_modified_time":"2026-03-21T12:29:27+00:00","og_image":[{"width":636,"height":334,"url":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2019\/08\/WordPress-Website-Flow-min.jpg","type":"image\/jpeg"}],"author":"Pallavi Godse","twitter_misc":{"Written by":"Pallavi Godse","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/fixing-error-establishing-a-database-connection-in-wordpress\/#article","isPartOf":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/fixing-error-establishing-a-database-connection-in-wordpress\/"},"author":{"name":"Pallavi Godse","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/7e3952607fa9eb4e82fea9f7cad9c945"},"headline":"Fixing Error Establishing a Database Connection in WordPress","datePublished":"2019-08-29T09:15:22+00:00","dateModified":"2026-03-21T12:29:27+00:00","mainEntityOfPage":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/fixing-error-establishing-a-database-connection-in-wordpress\/"},"wordCount":1101,"commentCount":0,"image":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/fixing-error-establishing-a-database-connection-in-wordpress\/#primaryimage"},"thumbnailUrl":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2019\/08\/WordPress-Website-Flow-min.jpg","keywords":["Common Errors in WordPress","WordPress","WordPress Database"],"articleSection":["Troubleshooting &amp; Errors"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.milesweb.in\/hosting-faqs\/fixing-error-establishing-a-database-connection-in-wordpress\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/fixing-error-establishing-a-database-connection-in-wordpress\/","url":"https:\/\/www.milesweb.in\/hosting-faqs\/fixing-error-establishing-a-database-connection-in-wordpress\/","name":"Fixing Error Establishing a Database Connection in WordPress","isPartOf":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/fixing-error-establishing-a-database-connection-in-wordpress\/#primaryimage"},"image":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/fixing-error-establishing-a-database-connection-in-wordpress\/#primaryimage"},"thumbnailUrl":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2019\/08\/WordPress-Website-Flow-min.jpg","datePublished":"2019-08-29T09:15:22+00:00","dateModified":"2026-03-21T12:29:27+00:00","author":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/7e3952607fa9eb4e82fea9f7cad9c945"},"description":"The article displays the steps that help in fixing the error establishing a database connection in WordPress.","breadcrumb":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/fixing-error-establishing-a-database-connection-in-wordpress\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.milesweb.in\/hosting-faqs\/fixing-error-establishing-a-database-connection-in-wordpress\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/fixing-error-establishing-a-database-connection-in-wordpress\/#primaryimage","url":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2019\/08\/WordPress-Website-Flow-min.jpg","contentUrl":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2019\/08\/WordPress-Website-Flow-min.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/fixing-error-establishing-a-database-connection-in-wordpress\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.milesweb.in\/hosting-faqs\/"},{"@type":"ListItem","position":2,"name":"Fixing Error Establishing a Database Connection in WordPress"}]},{"@type":"WebSite","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#website","url":"https:\/\/www.milesweb.in\/hosting-faqs\/","name":"Web Hosting FAQs by MilesWeb","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.milesweb.in\/hosting-faqs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/7e3952607fa9eb4e82fea9f7cad9c945","name":"Pallavi Godse","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/3602d0ac1ab89332aea8205dcf474af4ff4eb319cfd584544038908cd5e4c966?s=96&d=blank&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3602d0ac1ab89332aea8205dcf474af4ff4eb319cfd584544038908cd5e4c966?s=96&d=blank&r=g","caption":"Pallavi Godse"},"description":"Pallavi is a Digital Marketing Executive at MilesWeb and has an experience of over 4 years in content development. She is interested in writing engaging content on business, technology, web hosting and other topics related to information technology.","sameAs":["https:\/\/www.milesweb.in"],"url":"https:\/\/www.milesweb.in\/hosting-faqs\/author\/pallavi\/"}]}},"_links":{"self":[{"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/posts\/8154","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/users\/16"}],"replies":[{"embeddable":true,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/comments?post=8154"}],"version-history":[{"count":3,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/posts\/8154\/revisions"}],"predecessor-version":[{"id":8178,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/posts\/8154\/revisions\/8178"}],"wp:attachment":[{"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/media?parent=8154"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/categories?post=8154"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/tags?post=8154"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}