{"id":23,"date":"2021-11-12T03:33:02","date_gmt":"2021-11-12T03:33:02","guid":{"rendered":"http:\/\/localhost\/2\/wp\/2021\/11\/14\/ok-then\/"},"modified":"2021-11-20T18:44:14","modified_gmt":"2021-11-20T13:14:14","slug":"wordpress-error-establishing-database-connection","status":"publish","type":"post","link":"https:\/\/vvcares.com\/blog\/wordpress-error-establishing-database-connection\/","title":{"rendered":"WordPress multisite &#8211; error establishing database connection"},"content":{"rendered":"<p>If you have WordPress Multisite Error Establishing Database Connection on your WordPress website, it is a fatal error.<\/p>\n<p>This WordPress error occurs when WordPress is failed to make a DB connection to the database.<\/p>\n<p>1st check :<\/p>\n<pre><code>`DB_NAME, DB_USER, DB_PASSWORD, B_HOST`\r\n<\/code><\/pre>\n<p>&amp; each site&#8217;s <code>.htaccess<\/code> entries if it defines any site name statically..<\/p>\n<p>2nd check : `wp_config file &#8211;<\/p>\n<pre><code>define('MULTISITE', true);` \r\ndefine('COOKIE_DOMAIN', $_SERVER['HTTP_HOST'] );\r\n<\/code><\/pre>\n<p>Once u set this multisite config, you must reload your site &amp; login once to wp-admin..<\/p>\n<p>3rd check : <code>WP_DB tables &gt;&gt;<\/code><\/p>\n<pre><code>'wp_blogs' &gt;&gt; 'path' to \"\/\"`\r\n'wp_site\u2019  &gt;&gt;  'path' to \"\/\"\r\n<\/code><\/pre>\n<p>(dont mention any real path here, so it will take it dynamically)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you have WordPress Multisite Error Establishing Database Connection on your WordPress website, it is a fatal error. This WordPress error occurs when WordPress is failed to make a DB connection to the database. 1st check : `DB_NAME, DB_USER, DB_PASSWORD, B_HOST` &amp; each site&#8217;s .htaccess entries if it defines any site name statically.. 2nd check [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":66,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,14],"tags":[6],"class_list":["post-23","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-servers","category-website-designing","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/vvcares.com\/blog\/wp-json\/wp\/v2\/posts\/23","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vvcares.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vvcares.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vvcares.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/vvcares.com\/blog\/wp-json\/wp\/v2\/comments?post=23"}],"version-history":[{"count":0,"href":"https:\/\/vvcares.com\/blog\/wp-json\/wp\/v2\/posts\/23\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/vvcares.com\/blog\/wp-json\/wp\/v2\/media\/66"}],"wp:attachment":[{"href":"https:\/\/vvcares.com\/blog\/wp-json\/wp\/v2\/media?parent=23"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vvcares.com\/blog\/wp-json\/wp\/v2\/categories?post=23"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vvcares.com\/blog\/wp-json\/wp\/v2\/tags?post=23"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}