{"id":166386,"date":"2024-07-31T09:22:27","date_gmt":"2024-07-31T02:22:27","guid":{"rendered":"https:\/\/it.telkomuniversity.ac.id\/5-penyebab-error-establishing-a-database-connection\/"},"modified":"2025-02-03T15:01:47","modified_gmt":"2025-02-03T08:01:47","slug":"5-penyebab-error-establishing-a-database-connection","status":"publish","type":"post","link":"https:\/\/it.telkomuniversity.ac.id\/en\/5-penyebab-error-establishing-a-database-connection\/","title":{"rendered":"5 Causes of Error Establishing A Database Connection"},"content":{"rendered":"\n<p>In this increasingly connected world, having a website has become essential for businesses, organizations, and personal websites to interact with their audience.<\/p>\n\n\n\n<p>However, we often face technical glitches that can hinder our websites.<\/p>\n\n\n\n<p>One of the most common issues is the \u201cError Establishing A Database Connection\u201d.<\/p>\n\n\n\n<p>For website owners or developers, this error message can be a source of panic.<\/p>\n\n\n\n<p>But don&#8217;t worry, in this article, I will discuss, the causes, and steps you can take to resolve the issue.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Causes of Establishing A Database Connection Error<\/h2>\n\n\n\n<p>Next, let&#8217;s look at some common causes of \u201cError Establishing A Database Connection\u201d.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>1. Error in database connection information<\/strong><\/h3>\n\n\n\n<p>Such as an incorrect username, password, or host. The first step is to double-check your database account information in wp-config.php.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"798\" height=\"485\" src=\"https:\/\/it.telkomuniversity.ac.id\/wp-content\/uploads\/2024\/07\/5-Penyebab-Error-Establishing-A-Database-Connection.png\" alt=\"5 Penyebab Error Establishing A Database Connection\" class=\"wp-image-158890\" srcset=\"https:\/\/it.telkomuniversity.ac.id\/wp-content\/uploads\/2024\/07\/5-Penyebab-Error-Establishing-A-Database-Connection.png 798w, https:\/\/it.telkomuniversity.ac.id\/wp-content\/uploads\/2024\/07\/5-Penyebab-Error-Establishing-A-Database-Connection-300x182.png 300w, https:\/\/it.telkomuniversity.ac.id\/wp-content\/uploads\/2024\/07\/5-Penyebab-Error-Establishing-A-Database-Connection-768x467.png 768w, https:\/\/it.telkomuniversity.ac.id\/wp-content\/uploads\/2024\/07\/5-Penyebab-Error-Establishing-A-Database-Connection-255x155.png 255w\" sizes=\"auto, (max-width: 798px) 100vw, 798px\" \/><figcaption class=\"wp-element-caption\">Error in database connection information<\/figcaption><\/figure>\n\n\n\n<p>To ensure that the information entered is correct, reset the database password and update wp-config.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>2. Error in Wp-config Prefix Table<\/strong><\/h3>\n\n\n\n<p>The prefix table is a database prefix that will be used to measure data from a database that has been mixed between one type of data and another.<\/p>\n\n\n\n<p>Just like the username, database name, and database password, if they are incorrect in wp config, it will cause Error Establishing A Database Connection.<\/p>\n\n\n\n<p>To ensure that the table prefix you entered is correct, open the database through phpmyadmin and look at the contents of all table prefixes.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"399\" src=\"https:\/\/it.telkomuniversity.ac.id\/wp-content\/uploads\/2024\/07\/5-Penyebab-Error-Establishing-A-Database-Connection-1-1024x399.png\" alt=\"5 Penyebab Error Establishing A Database Connection 1\" class=\"wp-image-158887\" srcset=\"https:\/\/it.telkomuniversity.ac.id\/wp-content\/uploads\/2024\/07\/5-Penyebab-Error-Establishing-A-Database-Connection-1-1024x399.png 1024w, https:\/\/it.telkomuniversity.ac.id\/wp-content\/uploads\/2024\/07\/5-Penyebab-Error-Establishing-A-Database-Connection-1-300x117.png 300w, https:\/\/it.telkomuniversity.ac.id\/wp-content\/uploads\/2024\/07\/5-Penyebab-Error-Establishing-A-Database-Connection-1-768x299.png 768w, https:\/\/it.telkomuniversity.ac.id\/wp-content\/uploads\/2024\/07\/5-Penyebab-Error-Establishing-A-Database-Connection-1-1536x598.png 1536w, https:\/\/it.telkomuniversity.ac.id\/wp-content\/uploads\/2024\/07\/5-Penyebab-Error-Establishing-A-Database-Connection-1-255x99.png 255w, https:\/\/it.telkomuniversity.ac.id\/wp-content\/uploads\/2024\/07\/5-Penyebab-Error-Establishing-A-Database-Connection-1.png 1891w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Error in Wp-config Prefix Tables<\/figcaption><\/figure>\n\n\n\n<p>If you see all the table prefixes are the same and end with \u201c<em>\u201d then you&#8217;ve found it. By default the table prefix is \u201cwp<\/em>\u201d, so make sure in wp-config that the table prefix matches the database.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"820\" height=\"507\" src=\"https:\/\/it.telkomuniversity.ac.id\/wp-content\/uploads\/2024\/07\/5-Penyebab-Error-Establishing-A-Database-Connection-2.png\" alt=\"5 Penyebab Error Establishing A Database Connection 2\" class=\"wp-image-158885\" srcset=\"https:\/\/it.telkomuniversity.ac.id\/wp-content\/uploads\/2024\/07\/5-Penyebab-Error-Establishing-A-Database-Connection-2.png 820w, https:\/\/it.telkomuniversity.ac.id\/wp-content\/uploads\/2024\/07\/5-Penyebab-Error-Establishing-A-Database-Connection-2-300x185.png 300w, https:\/\/it.telkomuniversity.ac.id\/wp-content\/uploads\/2024\/07\/5-Penyebab-Error-Establishing-A-Database-Connection-2-768x475.png 768w, https:\/\/it.telkomuniversity.ac.id\/wp-content\/uploads\/2024\/07\/5-Penyebab-Error-Establishing-A-Database-Connection-2-818x507.png 818w, https:\/\/it.telkomuniversity.ac.id\/wp-content\/uploads\/2024\/07\/5-Penyebab-Error-Establishing-A-Database-Connection-2-255x158.png 255w\" sizes=\"auto, (max-width: 820px) 100vw, 820px\" \/><figcaption class=\"wp-element-caption\">5 Causes of Error Building Database Connection 2<\/figcaption><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">3. Server\/Hosting Disruption<\/h3>\n\n\n\n<p>One possibility is that database server interruption could also be the cause, perhaps due to high server load or overall server failure.<\/p>\n\n\n\n<p>If you are using Shared hosting and the storage is full then it can cause \u201cError in Obtaining Database Connection\u201d.<\/p>\n\n\n\n<p>We recommend that you double check the hosting capacity of your website, if it is full, you can immediately upgrade to a higher hosting package.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">4. One of the Database Tables is Broken<\/h3>\n\n\n\n<p>After you do the steps above and still haven&#8217;t found a solution to solve the database error on wordpress, maybe you can check if there are tables that crash \/ damage.<\/p>\n\n\n\n<p>How to find out which tables are damaged in the database you can follow these steps:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Open the hosting panel access then enter the \u201cpublic_html\u201d folder and search for \u201cwp_config.php\u201d Please edit the file by entering the following script below <strong>\/* That&#8217;s all, stop editing! Happy publishing. *\/.<\/strong><\/li>\n<\/ul>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>define (&#8216;WP_ALLOW_REPAIR&#8217;, true);<\/p>\n<\/blockquote>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"787\" height=\"251\" src=\"https:\/\/it.telkomuniversity.ac.id\/wp-content\/uploads\/2024\/07\/5-Penyebab-Error-Establishing-A-Database-Connection-4.png\" alt=\"5 Penyebab Error Establishing A Database Connection 4\" class=\"wp-image-158883\" srcset=\"https:\/\/it.telkomuniversity.ac.id\/wp-content\/uploads\/2024\/07\/5-Penyebab-Error-Establishing-A-Database-Connection-4.png 787w, https:\/\/it.telkomuniversity.ac.id\/wp-content\/uploads\/2024\/07\/5-Penyebab-Error-Establishing-A-Database-Connection-4-300x96.png 300w, https:\/\/it.telkomuniversity.ac.id\/wp-content\/uploads\/2024\/07\/5-Penyebab-Error-Establishing-A-Database-Connection-4-768x245.png 768w, https:\/\/it.telkomuniversity.ac.id\/wp-content\/uploads\/2024\/07\/5-Penyebab-Error-Establishing-A-Database-Connection-4-255x81.png 255w\" sizes=\"auto, (max-width: 787px) 100vw, 787px\" \/><figcaption class=\"wp-element-caption\">5 Causes of Error Establishing Database Connection 4<\/figcaption><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>After that, to run the script you can type <em><strong>https:\/\/domain kamu.com\/wp-admin\/maint\/repair.php , <\/strong><\/em><span style=\"color: #993366\"><span style=\"color: #000000\">After that, you will be directed to the page for repairing the database. <\/span><\/span><\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"537\" src=\"https:\/\/it.telkomuniversity.ac.id\/wp-content\/uploads\/2024\/07\/5-Penyebab-Error-Establishing-A-Database-Connection-3-1024x537.png\" alt=\"5 Penyebab Error Establishing A Database Connection 3\" class=\"wp-image-158881\" srcset=\"https:\/\/it.telkomuniversity.ac.id\/wp-content\/uploads\/2024\/07\/5-Penyebab-Error-Establishing-A-Database-Connection-3-1024x537.png 1024w, https:\/\/it.telkomuniversity.ac.id\/wp-content\/uploads\/2024\/07\/5-Penyebab-Error-Establishing-A-Database-Connection-3-300x157.png 300w, https:\/\/it.telkomuniversity.ac.id\/wp-content\/uploads\/2024\/07\/5-Penyebab-Error-Establishing-A-Database-Connection-3-768x403.png 768w, https:\/\/it.telkomuniversity.ac.id\/wp-content\/uploads\/2024\/07\/5-Penyebab-Error-Establishing-A-Database-Connection-3-255x134.png 255w, https:\/\/it.telkomuniversity.ac.id\/wp-content\/uploads\/2024\/07\/5-Penyebab-Error-Establishing-A-Database-Connection-3.png 1427w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>After this you only have to choose a few options, but in this case we will only repair the database. Please press the \u201cRepair Database\u201d button and wait for a while.<\/li>\n\n\n\n<li>After the scan process is complete, wordpress will show us if there are problematic tables. Usually wordpress will automatically fix it. But if this method has not worked you can do the next way.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"721\" src=\"https:\/\/it.telkomuniversity.ac.id\/wp-content\/uploads\/2024\/07\/5-Penyebab-Error-Establishing-A-Database-Connection-6-1024x721.png\" alt=\"5 Penyebab Error Establishing A Database Connection 6\" class=\"wp-image-158879\" srcset=\"https:\/\/it.telkomuniversity.ac.id\/wp-content\/uploads\/2024\/07\/5-Penyebab-Error-Establishing-A-Database-Connection-6-1024x721.png 1024w, https:\/\/it.telkomuniversity.ac.id\/wp-content\/uploads\/2024\/07\/5-Penyebab-Error-Establishing-A-Database-Connection-6-300x211.png 300w, https:\/\/it.telkomuniversity.ac.id\/wp-content\/uploads\/2024\/07\/5-Penyebab-Error-Establishing-A-Database-Connection-6-768x541.png 768w, https:\/\/it.telkomuniversity.ac.id\/wp-content\/uploads\/2024\/07\/5-Penyebab-Error-Establishing-A-Database-Connection-6-255x179.png 255w, https:\/\/it.telkomuniversity.ac.id\/wp-content\/uploads\/2024\/07\/5-Penyebab-Error-Establishing-A-Database-Connection-6.png 1381w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>After this is done, don&#8217;t forget to remove the added script or change its status from \u201ctrue\u201d to \u201cfalse\u201d.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">5. Repair Database Through PHPMYADMIN<\/h3>\n\n\n\n<p>If all the above methods still haven&#8217;t found a solution, you can try this last method by opening your database in phpMyAdmin.<\/p>\n\n\n\n<p>Usually, if you have already followed method 4, you will find a list of corrupted database tables, allowing you to repair the database.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"408\" src=\"https:\/\/it.telkomuniversity.ac.id\/wp-content\/uploads\/2024\/07\/5-Penyebab-Error-Establishing-A-Database-Connection-7-1024x408.png\" alt=\"5 Penyebab Error Establishing A Database Connection 7\" class=\"wp-image-158877\" srcset=\"https:\/\/it.telkomuniversity.ac.id\/wp-content\/uploads\/2024\/07\/5-Penyebab-Error-Establishing-A-Database-Connection-7-1024x408.png 1024w, https:\/\/it.telkomuniversity.ac.id\/wp-content\/uploads\/2024\/07\/5-Penyebab-Error-Establishing-A-Database-Connection-7-300x119.png 300w, https:\/\/it.telkomuniversity.ac.id\/wp-content\/uploads\/2024\/07\/5-Penyebab-Error-Establishing-A-Database-Connection-7-768x306.png 768w, https:\/\/it.telkomuniversity.ac.id\/wp-content\/uploads\/2024\/07\/5-Penyebab-Error-Establishing-A-Database-Connection-7-1536x612.png 1536w, https:\/\/it.telkomuniversity.ac.id\/wp-content\/uploads\/2024\/07\/5-Penyebab-Error-Establishing-A-Database-Connection-7-255x102.png 255w, https:\/\/it.telkomuniversity.ac.id\/wp-content\/uploads\/2024\/07\/5-Penyebab-Error-Establishing-A-Database-Connection-7.png 1846w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">5 Causes of Error Establishing Database Connection 4<\/figcaption><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>However, in some cases, the database tables cannot be detected by the WordPress repair feature in wp-config.php. (method 4). You can bulk all of them (check all the boxes in the database) and then repair all the tables in that database.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"509\" src=\"https:\/\/it.telkomuniversity.ac.id\/wp-content\/uploads\/2024\/07\/5-Penyebab-Error-Establishing-A-Database-Connection-8-1024x509.png\" alt=\"5 Penyebab Error Establishing A Database Connection 8\" class=\"wp-image-158875\" srcset=\"https:\/\/it.telkomuniversity.ac.id\/wp-content\/uploads\/2024\/07\/5-Penyebab-Error-Establishing-A-Database-Connection-8-1024x509.png 1024w, https:\/\/it.telkomuniversity.ac.id\/wp-content\/uploads\/2024\/07\/5-Penyebab-Error-Establishing-A-Database-Connection-8-300x149.png 300w, https:\/\/it.telkomuniversity.ac.id\/wp-content\/uploads\/2024\/07\/5-Penyebab-Error-Establishing-A-Database-Connection-8-768x382.png 768w, https:\/\/it.telkomuniversity.ac.id\/wp-content\/uploads\/2024\/07\/5-Penyebab-Error-Establishing-A-Database-Connection-8-1536x763.png 1536w, https:\/\/it.telkomuniversity.ac.id\/wp-content\/uploads\/2024\/07\/5-Penyebab-Error-Establishing-A-Database-Connection-8-255x127.png 255w, https:\/\/it.telkomuniversity.ac.id\/wp-content\/uploads\/2024\/07\/5-Penyebab-Error-Establishing-A-Database-Connection-8.png 1896w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">5 Causes of Error Establishing Database Connection 4<\/figcaption><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>Well, those are some ways to address &#8220;Error in Obtaining Database Connection.&#8221; Make sure you have tried all the steps mentioned above so that your website can function normally again.<\/p>\n\n\n\n<p>Overcoming &#8220;Error Establishing A Database Connection&#8221; may seem complicated at first, but with the right understanding and appropriate actions.<\/p>\n\n\n\n<p>You can overcome this issue and restore your website to good working condition.<\/p>\n\n\n\n<p><strong>Author: Mujaddid Halimurrosyid | <a href=\"https:\/\/www.instagram.com\/halimurrosyid28\/\"><em>Instagram<\/em><\/a><\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this increasingly connected world, having a website has become essential for businesses, organizations, and personal websites to interact with their audience. However, we often face technical glitches that can hinder our websites. One of the most common issues is the \u201cError Establishing A Database Connection\u201d. For website owners or developers, this error message can [&hellip;]<\/p>\n","protected":false},"author":41,"featured_media":158896,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"wds_primary_category":176,"footnotes":""},"categories":[176,182],"tags":[],"class_list":["post-166386","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blogs","category-blogs-en"],"blocksy_meta":[],"gutentor_comment":0,"_links":{"self":[{"href":"https:\/\/it.telkomuniversity.ac.id\/en\/wp-json\/wp\/v2\/posts\/166386","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/it.telkomuniversity.ac.id\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/it.telkomuniversity.ac.id\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/it.telkomuniversity.ac.id\/en\/wp-json\/wp\/v2\/users\/41"}],"replies":[{"embeddable":true,"href":"https:\/\/it.telkomuniversity.ac.id\/en\/wp-json\/wp\/v2\/comments?post=166386"}],"version-history":[{"count":0,"href":"https:\/\/it.telkomuniversity.ac.id\/en\/wp-json\/wp\/v2\/posts\/166386\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/it.telkomuniversity.ac.id\/en\/wp-json\/wp\/v2\/media\/158896"}],"wp:attachment":[{"href":"https:\/\/it.telkomuniversity.ac.id\/en\/wp-json\/wp\/v2\/media?parent=166386"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/it.telkomuniversity.ac.id\/en\/wp-json\/wp\/v2\/categories?post=166386"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/it.telkomuniversity.ac.id\/en\/wp-json\/wp\/v2\/tags?post=166386"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}