{"id":1322,"date":"2022-02-23T11:43:22","date_gmt":"2022-02-23T06:13:22","guid":{"rendered":"https:\/\/hostkicker.com\/blog\/?p=1322"},"modified":"2022-05-17T11:38:33","modified_gmt":"2022-05-17T06:08:33","slug":"how-to-fix-the-error-establishing-a-database-connection-in-wordpress","status":"publish","type":"post","link":"https:\/\/hostkicker.com\/blog\/how-to-fix-the-error-establishing-a-database-connection-in-wordpress\/","title":{"rendered":"How to Fix the Error Establishing a Database Connection in WordPress"},"content":{"rendered":"<p><span data-preserver-spaces=\"true\">Do you notice the &#8216;Error establishing a database connection&#8217; message on your WordPress website? This tutorial will discuss how to fix the error establishing a database connection in WordPress.<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">It is a destructive error that makes your WordPress website unavailable to the users. This error appears when WordPress cannot make a connection to the database.\u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">A lot of things can affect your WordPress database connection which makes it difficult for users to fix the issue.<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">Don&#8217;t worry. Step ahead to fix the error establishing a database connection in WordPress.<\/span><\/p>\n<h4><span data-preserver-spaces=\"true\">Why does the Error Establishing a Database Connection occur in WordPress?<\/span><\/h4>\n<p><span data-preserver-spaces=\"true\">The &#8216;Error establishing a database connection problem may occur by incorrect database details in your WordPress settings, an irresponsive database server, or corrupt database.<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1323\" src=\"https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2022\/02\/dbconnectionerrorwp.png\" alt=\"\" width=\"550\" height=\"182\" srcset=\"https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2022\/02\/dbconnectionerrorwp.png 550w, https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2022\/02\/dbconnectionerrorwp-300x99.png 300w\" sizes=\"auto, (max-width: 550px) 100vw, 550px\" \/><\/p>\n<p><span data-preserver-spaces=\"true\">A database easily organizes, store, and retrieve data into other software.<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">As a CMS, WordPress utilizes a database to store your content and all other website data. Each time someone visits your site, it connects to the database.<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">WordPress requires the Database name, username, password, and server details for connecting to the database.<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">These details are stored in your WordPress configuration file named wp-config.php.<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">If any of the information is found to be incorrect, WordPress fails to connect to your database server, and you will see the &#8216;Error establishing a database connection&#8217; alert.<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">This is the most common WordPress error you may counter. Besides these incorrect details, this error may also occur if the database files are corrupt or the database server is down.<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">Now, let us explain how to fix the error establishing database connection problem in WordPress.<\/span><\/p>\n<h4><strong><span data-preserver-spaces=\"true\">Check Database Credentials In Your WordPress\u00a0<\/span><\/strong><\/h4>\n<p><span data-preserver-spaces=\"true\">The most common cause for database connection errors in WordPress is incorrect database details. If you have newly shifted your WordPress site to a new host, then this may be the most likely reason.<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">In WordPress, your database credentials\/details are stored in the wp-config.php file. It contains important WordPress settings together with database details.<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">Now, edit the wp-config.php file and look for the following lines in your wp-config.php file.<\/span><\/p>\n<pre><span data-preserver-spaces=\"true\"> \/\/ ** MySQL settings - You can get this info from your web host ** \/\/<\/span>\r\n\r\n<span data-preserver-spaces=\"true\">\/** The name of the database for WordPress *\/<\/span>\r\n\r\n<span data-preserver-spaces=\"true\">define( 'DB_NAME', 'database_name_here' );<\/span>\r\n\r\n<span data-preserver-spaces=\"true\">\/** MySQL database username *\/<\/span>\r\n\r\n<span data-preserver-spaces=\"true\">define( 'DB_USER', 'username_here' );<\/span>\r\n\r\n<span data-preserver-spaces=\"true\">\/** MySQL database password *\/<\/span>\r\n\r\n<span data-preserver-spaces=\"true\">define( 'DB_PASSWORD', 'password_here' );<\/span>\r\n\r\n<span data-preserver-spaces=\"true\">\/** MySQL hostname *\/<\/span>\r\n\r\n<span data-preserver-spaces=\"true\">define( 'DB_HOST', 'localhost' );<\/span><\/pre>\n<p><span data-preserver-spaces=\"true\">You have to check that the database name, username, password, and database host details are right and accurate.<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">You can also confirm these details from your WordPress hosting account dashboard. For that, log in to your hosting account and click the MySQL databases under the database menu.<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1324\" src=\"https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2022\/02\/dbhostingaccoun.png\" alt=\"\" width=\"550\" height=\"326\" srcset=\"https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2022\/02\/dbhostingaccoun.png 550w, https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2022\/02\/dbhostingaccoun-300x178.png 300w\" sizes=\"auto, (max-width: 550px) 100vw, 550px\" \/><\/p>\n<p><span data-preserver-spaces=\"true\">Now you will reach the database management page in your hosting dashboard. You can see your database name and the username here.<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1325\" src=\"https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2022\/02\/dbinfo.png\" alt=\"\" width=\"550\" height=\"201\" srcset=\"https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2022\/02\/dbinfo.png 550w, https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2022\/02\/dbinfo-300x110.png 300w\" sizes=\"auto, (max-width: 550px) 100vw, 550px\" \/><\/p>\n<p><span data-preserver-spaces=\"true\">Under that, you will notice the database users and links to change the user password.<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1326\" src=\"https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2022\/02\/dbuser.png\" alt=\"\" width=\"550\" height=\"174\" srcset=\"https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2022\/02\/dbuser.png 550w, https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2022\/02\/dbuser-300x95.png 300w\" sizes=\"auto, (max-width: 550px) 100vw, 550px\" \/><\/p>\n<p><span data-preserver-spaces=\"true\">Once you confirm your database name, username, and password are correct, or if not, you can change that in your wp-config.php file if needed.<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">After that, visit your website again to see if the database connection error has disappeared or not.<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">If you still notice the error, then something else is creating the error. <\/span><span data-preserver-spaces=\"true\">If so, move on to the next step to fix this.<\/span><\/p>\n<h4><strong><span data-preserver-spaces=\"true\">Check Your Database Host Details<\/span><\/strong><\/h4>\n<p><span data-preserver-spaces=\"true\">If you are sure that your database name, username, and password details are correct, then you can check out that you are using the correct database hosting details.<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">Many WordPress hosting companies use localhost as your database host. However, some managed WordPress hosting companies use separate servers to host databases. In that case, your database host information will not be localhost.<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">To confirm your database host details, you must contact your WordPress hosting company.<\/span><\/p>\n<h4><strong><span data-preserver-spaces=\"true\">Repair WordPress Database<\/span><\/strong><\/h4>\n<p><span data-preserver-spaces=\"true\">If you are noticing a different error on the wp-admin, such as &#8220;Database tables are unavailable. The database needs to be repaired&#8221;, In that case, you have to repair your database.<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">To do this, You have to add the following line in your wp-config.php file. Add it just before the line says, &#8216;That&#8217;s all, stop editing! Happy blogging&#8217; line wp-config.php.<\/span><\/p>\n<pre><span data-preserver-spaces=\"true\"> define('WP_ALLOW_REPAIR', true);\r\n\r\n<\/span><\/pre>\n<p><span data-preserver-spaces=\"true\">After that, you can notice the settings by visiting the page: <em>http:\/\/www.yoursite.com\/wp-admin\/maint\/repair.php<\/em><\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1327\" src=\"https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2022\/02\/repairwpdb.png\" alt=\"\" width=\"550\" height=\"291\" srcset=\"https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2022\/02\/repairwpdb.png 550w, https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2022\/02\/repairwpdb-300x159.png 300w\" sizes=\"auto, (max-width: 550px) 100vw, 550px\" \/><\/p>\n<p><strong><span data-preserver-spaces=\"true\">Note:<\/span><\/strong><span data-preserver-spaces=\"true\"> To access the database repair page, the user does not have to be logged in. After repairing and optimizing your database, you can remove this code from your wp-config.php.<\/span><\/p>\n<h4><strong><span data-preserver-spaces=\"true\">Check whether Your Database Server is Down<\/span><\/strong><span data-preserver-spaces=\"true\">.<\/span><\/h4>\n<p><span data-preserver-spaces=\"true\">In case everything appears to be correct, but WordPress still cannot connect to the database, your database server or (MySQL server) may be down.<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">This may occur due to heavy traffic on your server. Meaning your host server cannot handle the load (especially when you are using shared hosting).<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">Due to this, Your site gets very slow, and for some users, it may even display the error.\u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">In that case, you can live chat or get in touch with your hosting provider and ask them if your MySQL server is responsible.<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">If you are running other websites on the same server, then you can test those sites to confirm that your SQL server is actually down or not.<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">In case, you don&#8217;t run any other site on the same hosting server, then visit your hosting dashboard and try to access your phpMyAdmin and connect the database.<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">If you are able to connect, then we have to verify if your database user has sufficient permission.\u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">For that, create a new file with the title testconnection.php and paste the following code in it:<\/span><\/p>\n<pre><span data-preserver-spaces=\"true\"> &lt;?php<\/span>\r\n\r\n<span data-preserver-spaces=\"true\">$link = mysqli_connect('localhost', 'username', 'password');<\/span>\r\n\r\n<span data-preserver-spaces=\"true\">if (!$link) {<\/span>\r\n\r\n<span data-preserver-spaces=\"true\">die('Could not connect: ' . mysqli_error());<\/span>\r\n\r\n<span data-preserver-spaces=\"true\">}<\/span>\r\n\r\n<span data-preserver-spaces=\"true\">echo 'Connected successfully';<\/span>\r\n\r\n<span data-preserver-spaces=\"true\">mysqli_close($link);<\/span>\r\n\r\n<span data-preserver-spaces=\"true\">?&gt;<\/span><\/pre>\n<p><strong><span data-preserver-spaces=\"true\">Note:<\/span><\/strong><span data-preserver-spaces=\"true\">\u00a0Please replace the username and password with yours in the above code.\u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">Then, upload this file to your website and access it via a web browser.<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">If the script is connected successfully, then it suggests that your user has sufficient permission, and something else is wrong there.<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">Now return to your wp-config file to check everything is correct there (re-scan for typos).<\/span><\/p>\n<h4><span data-preserver-spaces=\"true\">Other Solutions That May Work\u00a0<\/span><\/h4>\n<p><span data-preserver-spaces=\"true\">If the ways mentioned above fail to fix the database connection error on your site, then you can try these additional ways.\u00a0<\/span><\/p>\n<h5><strong><span data-preserver-spaces=\"true\">1. Update WordPress Site URL<\/span><\/strong><\/h5>\n<p><span data-preserver-spaces=\"true\">To fix the database connection error, you can try to update the WordPress site URL using phpMyAdmin.\u00a0<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">To do that, access your phpMyAdmin from your hosting account dashboard, and select the WordPress database.<\/span><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1328\" src=\"https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2022\/02\/sqlphpmyadmin.png\" alt=\"\" width=\"550\" height=\"273\" srcset=\"https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2022\/02\/sqlphpmyadmin.png 550w, https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2022\/02\/sqlphpmyadmin-300x149.png 300w\" sizes=\"auto, (max-width: 550px) 100vw, 550px\" \/><\/p>\n<p><span data-preserver-spaces=\"true\">Then, click the SQL option on the top and enter the MySQL query given below:<\/span><\/p>\n<pre><span data-preserver-spaces=\"true\"> UPDATE wp_options SET option_value='YOUR_SITE_URL' WHERE option_name='siteurl'<\/span><\/pre>\n<p><strong><span data-preserver-spaces=\"true\">Note:<\/span><\/strong><span data-preserver-spaces=\"true\">\u00a0Enter your own site URL and change wp_options to your own table name as you may have renamed the WordPress table prefix.<\/span><\/p>\n<h5><strong><span data-preserver-spaces=\"true\">2. Rebooting Web Server<\/span><\/strong><\/h5>\n<p><span data-preserver-spaces=\"true\">Users on local servers, virtual private servers (VPS), and dedicated servers can try to reboot their servers.<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">Your web and database servers will be restarted, which may resolve the temporary problems or malfunctions causing the error.<\/span><\/p>\n<h5><strong><span data-preserver-spaces=\"true\">3. Ask for help<\/span><\/strong><\/h5>\n<p><span data-preserver-spaces=\"true\">If everything fails to resolve the database connection error, then you have to contact your web hosting company. All good and user-friendly WordPress hosting companies will help you fix the problem, give you the right instructions, or even fix it for you.<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">You can also contact WordPress developers you may know that can help you fix this issue at a low price.<\/span><\/p>\n<p><span data-preserver-spaces=\"true\">We hope this helped you fix the error establishing a database connection in your WordPress. We have also covered articles on<a href=\"https:\/\/hostkicker.com\/blog\/how-to-fix-the-critical-error-in-wordpress\/\"> How to fix the critical error in WordPress<\/a> and a complete guide on <a href=\"https:\/\/hostkicker.com\/blog\/what-to-do-when-you-are-locked-out-of-wordpress-admin-area\/\">what to do when you are locked out of the admin area.<\/a><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Do you notice the &#8216;Error establishing a database connection&#8217; message on your WordPress website? This tutorial will discuss how to fix the error establishing a database connection in WordPress. It is a destructive error that makes your WordPress website unavailable to the users. This error appears when WordPress cannot make a connection to the database.\u00a0 [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":1350,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1322","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-wp-tutorials"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v19.3 (Yoast SEO v27.5) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>How to Fix the Error Establishing a Database Connection in WordPress<\/title>\n<meta name=\"description\" content=\"To Fix the Error Establishing a Database Connection in WordPress, Check Database Credentials\u00a0&amp; then, update the site URL by the SQL option...\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/hostkicker.com\/blog\/how-to-fix-the-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=\"How to Fix the Error Establishing a Database Connection in WordPress\" \/>\n<meta property=\"og:description\" content=\"To Fix the Error Establishing a Database Connection in WordPress, Check Database Credentials\u00a0&amp; then, update the site URL by the SQL option...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/hostkicker.com\/blog\/how-to-fix-the-error-establishing-a-database-connection-in-wordpress\/\" \/>\n<meta property=\"og:site_name\" content=\"Hostkicker\" \/>\n<meta property=\"article:published_time\" content=\"2022-02-23T06:13:22+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-05-17T06:08:33+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2022\/02\/MicrosoftTeams-image-42.png\" \/>\n\t<meta property=\"og:image:width\" content=\"693\" \/>\n\t<meta property=\"og:image:height\" content=\"511\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Olivia Smith\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Olivia Smith\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":[\"Article\",\"BlogPosting\"],\"@id\":\"https:\\\/\\\/hostkicker.com\\\/blog\\\/how-to-fix-the-error-establishing-a-database-connection-in-wordpress\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/hostkicker.com\\\/blog\\\/how-to-fix-the-error-establishing-a-database-connection-in-wordpress\\\/\"},\"author\":{\"name\":\"Olivia Smith\",\"@id\":\"https:\\\/\\\/hostkicker.com\\\/blog\\\/#\\\/schema\\\/person\\\/f06306b595baa96c90a0491b941d7660\"},\"headline\":\"How to Fix the Error Establishing a Database Connection in WordPress\",\"datePublished\":\"2022-02-23T06:13:22+00:00\",\"dateModified\":\"2022-05-17T06:08:33+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/hostkicker.com\\\/blog\\\/how-to-fix-the-error-establishing-a-database-connection-in-wordpress\\\/\"},\"wordCount\":1206,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/hostkicker.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/hostkicker.com\\\/blog\\\/how-to-fix-the-error-establishing-a-database-connection-in-wordpress\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/hostkicker.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/MicrosoftTeams-image-42.png\",\"articleSection\":[\"Wp tutorials\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/hostkicker.com\\\/blog\\\/how-to-fix-the-error-establishing-a-database-connection-in-wordpress\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/hostkicker.com\\\/blog\\\/how-to-fix-the-error-establishing-a-database-connection-in-wordpress\\\/\",\"url\":\"https:\\\/\\\/hostkicker.com\\\/blog\\\/how-to-fix-the-error-establishing-a-database-connection-in-wordpress\\\/\",\"name\":\"How to Fix the Error Establishing a Database Connection in WordPress\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/hostkicker.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/hostkicker.com\\\/blog\\\/how-to-fix-the-error-establishing-a-database-connection-in-wordpress\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/hostkicker.com\\\/blog\\\/how-to-fix-the-error-establishing-a-database-connection-in-wordpress\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/hostkicker.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/MicrosoftTeams-image-42.png\",\"datePublished\":\"2022-02-23T06:13:22+00:00\",\"dateModified\":\"2022-05-17T06:08:33+00:00\",\"description\":\"To Fix the Error Establishing a Database Connection in WordPress, Check Database Credentials\u00a0& then, update the site URL by the SQL option...\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/hostkicker.com\\\/blog\\\/how-to-fix-the-error-establishing-a-database-connection-in-wordpress\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/hostkicker.com\\\/blog\\\/how-to-fix-the-error-establishing-a-database-connection-in-wordpress\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/hostkicker.com\\\/blog\\\/how-to-fix-the-error-establishing-a-database-connection-in-wordpress\\\/#primaryimage\",\"url\":\"https:\\\/\\\/hostkicker.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/MicrosoftTeams-image-42.png\",\"contentUrl\":\"https:\\\/\\\/hostkicker.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/02\\\/MicrosoftTeams-image-42.png\",\"width\":693,\"height\":511,\"caption\":\"To Fix the Error Establishing a Database Connection in WordPress, Check Database Credentials\u00a0& then, update the site URL by the SQL option.\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/hostkicker.com\\\/blog\\\/how-to-fix-the-error-establishing-a-database-connection-in-wordpress\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/hostkicker.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Fix the Error Establishing a Database Connection in WordPress\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/hostkicker.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/hostkicker.com\\\/blog\\\/\",\"name\":\"Hostkicker\",\"description\":\"Blog\",\"publisher\":{\"@id\":\"https:\\\/\\\/hostkicker.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/hostkicker.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/hostkicker.com\\\/blog\\\/#organization\",\"name\":\"Hostkicker\",\"url\":\"https:\\\/\\\/hostkicker.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/hostkicker.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/hostkicker.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/12\\\/hostkicker-logo-01.png\",\"contentUrl\":\"https:\\\/\\\/hostkicker.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/12\\\/hostkicker-logo-01.png\",\"width\":940,\"height\":218,\"caption\":\"Hostkicker\"},\"image\":{\"@id\":\"https:\\\/\\\/hostkicker.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/hostkicker.com\\\/blog\\\/#\\\/schema\\\/person\\\/f06306b595baa96c90a0491b941d7660\",\"name\":\"Olivia Smith\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/24a6b2466362238ad275f97a2f2fc49ce8d139c034114d6b9c52de1b12ebf1bd?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/24a6b2466362238ad275f97a2f2fc49ce8d139c034114d6b9c52de1b12ebf1bd?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/24a6b2466362238ad275f97a2f2fc49ce8d139c034114d6b9c52de1b12ebf1bd?s=96&d=mm&r=g\",\"caption\":\"Olivia Smith\"},\"url\":\"https:\\\/\\\/hostkicker.com\\\/blog\\\/author\\\/olivia\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to Fix the Error Establishing a Database Connection in WordPress","description":"To Fix the Error Establishing a Database Connection in WordPress, Check Database Credentials\u00a0& then, update the site URL by the SQL option...","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:\/\/hostkicker.com\/blog\/how-to-fix-the-error-establishing-a-database-connection-in-wordpress\/","og_locale":"en_US","og_type":"article","og_title":"How to Fix the Error Establishing a Database Connection in WordPress","og_description":"To Fix the Error Establishing a Database Connection in WordPress, Check Database Credentials\u00a0& then, update the site URL by the SQL option...","og_url":"https:\/\/hostkicker.com\/blog\/how-to-fix-the-error-establishing-a-database-connection-in-wordpress\/","og_site_name":"Hostkicker","article_published_time":"2022-02-23T06:13:22+00:00","article_modified_time":"2022-05-17T06:08:33+00:00","og_image":[{"width":693,"height":511,"url":"https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2022\/02\/MicrosoftTeams-image-42.png","type":"image\/png"}],"author":"Olivia Smith","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Olivia Smith","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":["Article","BlogPosting"],"@id":"https:\/\/hostkicker.com\/blog\/how-to-fix-the-error-establishing-a-database-connection-in-wordpress\/#article","isPartOf":{"@id":"https:\/\/hostkicker.com\/blog\/how-to-fix-the-error-establishing-a-database-connection-in-wordpress\/"},"author":{"name":"Olivia Smith","@id":"https:\/\/hostkicker.com\/blog\/#\/schema\/person\/f06306b595baa96c90a0491b941d7660"},"headline":"How to Fix the Error Establishing a Database Connection in WordPress","datePublished":"2022-02-23T06:13:22+00:00","dateModified":"2022-05-17T06:08:33+00:00","mainEntityOfPage":{"@id":"https:\/\/hostkicker.com\/blog\/how-to-fix-the-error-establishing-a-database-connection-in-wordpress\/"},"wordCount":1206,"commentCount":0,"publisher":{"@id":"https:\/\/hostkicker.com\/blog\/#organization"},"image":{"@id":"https:\/\/hostkicker.com\/blog\/how-to-fix-the-error-establishing-a-database-connection-in-wordpress\/#primaryimage"},"thumbnailUrl":"https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2022\/02\/MicrosoftTeams-image-42.png","articleSection":["Wp tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/hostkicker.com\/blog\/how-to-fix-the-error-establishing-a-database-connection-in-wordpress\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/hostkicker.com\/blog\/how-to-fix-the-error-establishing-a-database-connection-in-wordpress\/","url":"https:\/\/hostkicker.com\/blog\/how-to-fix-the-error-establishing-a-database-connection-in-wordpress\/","name":"How to Fix the Error Establishing a Database Connection in WordPress","isPartOf":{"@id":"https:\/\/hostkicker.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/hostkicker.com\/blog\/how-to-fix-the-error-establishing-a-database-connection-in-wordpress\/#primaryimage"},"image":{"@id":"https:\/\/hostkicker.com\/blog\/how-to-fix-the-error-establishing-a-database-connection-in-wordpress\/#primaryimage"},"thumbnailUrl":"https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2022\/02\/MicrosoftTeams-image-42.png","datePublished":"2022-02-23T06:13:22+00:00","dateModified":"2022-05-17T06:08:33+00:00","description":"To Fix the Error Establishing a Database Connection in WordPress, Check Database Credentials\u00a0& then, update the site URL by the SQL option...","breadcrumb":{"@id":"https:\/\/hostkicker.com\/blog\/how-to-fix-the-error-establishing-a-database-connection-in-wordpress\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/hostkicker.com\/blog\/how-to-fix-the-error-establishing-a-database-connection-in-wordpress\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/hostkicker.com\/blog\/how-to-fix-the-error-establishing-a-database-connection-in-wordpress\/#primaryimage","url":"https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2022\/02\/MicrosoftTeams-image-42.png","contentUrl":"https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2022\/02\/MicrosoftTeams-image-42.png","width":693,"height":511,"caption":"To Fix the Error Establishing a Database Connection in WordPress, Check Database Credentials\u00a0& then, update the site URL by the SQL option."},{"@type":"BreadcrumbList","@id":"https:\/\/hostkicker.com\/blog\/how-to-fix-the-error-establishing-a-database-connection-in-wordpress\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/hostkicker.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Fix the Error Establishing a Database Connection in WordPress"}]},{"@type":"WebSite","@id":"https:\/\/hostkicker.com\/blog\/#website","url":"https:\/\/hostkicker.com\/blog\/","name":"Hostkicker","description":"Blog","publisher":{"@id":"https:\/\/hostkicker.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/hostkicker.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/hostkicker.com\/blog\/#organization","name":"Hostkicker","url":"https:\/\/hostkicker.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/hostkicker.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2021\/12\/hostkicker-logo-01.png","contentUrl":"https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2021\/12\/hostkicker-logo-01.png","width":940,"height":218,"caption":"Hostkicker"},"image":{"@id":"https:\/\/hostkicker.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/hostkicker.com\/blog\/#\/schema\/person\/f06306b595baa96c90a0491b941d7660","name":"Olivia Smith","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/24a6b2466362238ad275f97a2f2fc49ce8d139c034114d6b9c52de1b12ebf1bd?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/24a6b2466362238ad275f97a2f2fc49ce8d139c034114d6b9c52de1b12ebf1bd?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/24a6b2466362238ad275f97a2f2fc49ce8d139c034114d6b9c52de1b12ebf1bd?s=96&d=mm&r=g","caption":"Olivia Smith"},"url":"https:\/\/hostkicker.com\/blog\/author\/olivia\/"}]}},"jetpack_featured_media_url":"https:\/\/hostkicker.com\/blog\/wp-content\/uploads\/2022\/02\/MicrosoftTeams-image-42.png","_links":{"self":[{"href":"https:\/\/hostkicker.com\/blog\/wp-json\/wp\/v2\/posts\/1322","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hostkicker.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hostkicker.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hostkicker.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/hostkicker.com\/blog\/wp-json\/wp\/v2\/comments?post=1322"}],"version-history":[{"count":5,"href":"https:\/\/hostkicker.com\/blog\/wp-json\/wp\/v2\/posts\/1322\/revisions"}],"predecessor-version":[{"id":1730,"href":"https:\/\/hostkicker.com\/blog\/wp-json\/wp\/v2\/posts\/1322\/revisions\/1730"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/hostkicker.com\/blog\/wp-json\/wp\/v2\/media\/1350"}],"wp:attachment":[{"href":"https:\/\/hostkicker.com\/blog\/wp-json\/wp\/v2\/media?parent=1322"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hostkicker.com\/blog\/wp-json\/wp\/v2\/categories?post=1322"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hostkicker.com\/blog\/wp-json\/wp\/v2\/tags?post=1322"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}