{"id":6190,"date":"2021-03-20T19:42:33","date_gmt":"2021-03-20T14:12:33","guid":{"rendered":"https:\/\/pheonixsolutions.com\/blog\/?p=6190"},"modified":"2021-03-20T19:42:36","modified_gmt":"2021-03-20T14:12:36","slug":"error-establishing-a-database-connection-2","status":"publish","type":"post","link":"https:\/\/pheonixsolutions.com\/blog\/error-establishing-a-database-connection-2\/","title":{"rendered":"Error Establishing a Database Connection"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">When you see the above message, the problem is clear: WordPress can not connect to the site\u2019s database.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Most times, this common WordPress error is caused by faulty credentials inside wp-config.php.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Check wp-config.php<\/strong>:-<br>1) This file holds all the login info for the database that you entered at installation (database name, username, password and server).<br>2) Recheck the credentials. Mostly, issue will be solved here. If it is not solved, then go to the next step.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Access wp-admin:-<\/strong><br>Sometimes things go wrong with the database which cause the need for WordPress to fix it. In those cases, when you go to\u00a0<em>yoursite.com\/wp-admin<\/em>, you will see a different kind of error message stating that your database needs to be repaired.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If that is the case, add the following line to\u00a0<em>wp-config.php<\/em>\u00a0to enable this feature:<br>define(&#8216;WP_ALLOW_REPAIR&#8217;, true);<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">After that, access\u00a0<em>http:\/\/www.yoursite.com\/wp-admin\/maint\/repair.php<\/em>\u00a0to start the process. When you are done, be sure to remove the line from\u00a0<em>wp-config.php<\/em>\u00a0again as other people will be able to access this function otherwise.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When you see the above message, the problem is clear: WordPress can not connect to the site\u2019s database. Most times, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1022],"tags":[838,837],"class_list":["post-6190","post","type-post","status-publish","format-standard","hentry","category-web-architecture","tag-databse-connection-issues","tag-wordpress-database-connection-issue","psol-cat-web-architecture"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/phn2x7-1BQ","jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/6190","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=6190"}],"version-history":[{"count":0,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/6190\/revisions"}],"wp:attachment":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=6190"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=6190"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=6190"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}