{"id":28024,"date":"2024-05-17T13:03:25","date_gmt":"2024-05-17T12:03:25","guid":{"rendered":"https:\/\/wp-space.de\/?p=28024"},"modified":"2025-12-30T10:36:01","modified_gmt":"2025-12-30T09:36:01","slug":"error-when-establishing-a-database-connection","status":"publish","type":"post","link":"https:\/\/wp-space.de\/en\/error-when-establishing-a-database-connection\/","title":{"rendered":"Fix error message \"Error establishing a database connection\" in WordPress itself"},"content":{"rendered":"<img decoding=\"async\" src=\"https:\/\/vg08.met.vgwort.de\/na\/855fa8032ebd4c74b447fe9c8eb8c260\" width=\"1\" height=\"1\" alt=\"\">\n\n\n\n<p>Are you getting a white screen of death with the error message \"Error establishing a database connection\" when you visit your WordPress website? This is one of the most common errors on websites and can (usually) be fixed quickly.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img fetchpriority=\"high\" decoding=\"async\" width=\"781\" height=\"143\" src=\"https:\/\/wp-space.de\/wp-content\/uploads\/2024\/05\/FehlerbeimAufbaueinerDatenbankverbindung.png\" alt=\"Error message Error when establishing a database connection\" class=\"wp-image-29772\" srcset=\"https:\/\/wp-space.de\/wp-content\/uploads\/2024\/05\/FehlerbeimAufbaueinerDatenbankverbindung.png 781w, https:\/\/wp-space.de\/wp-content\/uploads\/2024\/05\/FehlerbeimAufbaueinerDatenbankverbindung-300x55.png 300w, https:\/\/wp-space.de\/wp-content\/uploads\/2024\/05\/FehlerbeimAufbaueinerDatenbankverbindung-768x141.png 768w, https:\/\/wp-space.de\/wp-content\/uploads\/2024\/05\/FehlerbeimAufbaueinerDatenbankverbindung-18x3.png 18w\" sizes=\"(max-width: 781px) 100vw, 781px\" \/><\/figure>\n\n\n\n<p><strong>So don't worry:<\/strong> This step-by-step guide will show you how to fix the \"Error establishing a database connection\" error.<\/p>\n\n\n\n<p>To test the various proposed solutions for your website, you need: <\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Access to the <a href=\"https:\/\/wp-space.de\/en\/\">WordPress hosting<\/a> your website <\/li>\n\n\n\n<li>Depending on the hoster: FTP access <\/li>\n\n\n\n<li>Depending on the hoster: Access to phpMyAdmin<\/li>\n<\/ul>\n\n\n\n<p>In the following, we will go into the solutions to the various causes of the error message. In the vast majority of cases, it is due to incorrect database user data in wp-config.php. Let's start with that right now!<\/p>\n\n\n\n<p><b>Note \ud83d\udca1:<\/b> Before you start with the various troubleshooting options, we recommend that you carry out a <a href=\"https:\/\/wp-space.de\/en\/create-wordpress-backup\/\">Backup your WordPress website<\/a> to create. <\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Incorrect database user data stored in wp-config.php<\/h2>\n\n\n\n<p>As <a href=\"https:\/\/wp-space.de\/en\/about-wpspace\/\">WordPress hoster<\/a> we regularly support our customers in resolving the error \"Error when establishing a database connection\". In 98 % of the support cases, the website operators receive the error message due to incorrect database user data in wp-config.php.<\/p>\n\n\n\n<p>The \"wp-config.php\" file is a standard file that is present in every root directory of a WordPress instance. <\/p>\n\n\n\n<p>In \"wp-config.php you will find four database details that must match the database used. If one of the four entries does not match, the white screen of death will be displayed on your website. <\/p>\n\n\n\n<p><strong>1. database name<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"355\" height=\"43\" src=\"https:\/\/wp-space.de\/wp-content\/uploads\/2024\/04\/Datenbankname.png\" alt=\"Database name wp-config.php\" class=\"wp-image-28039\" srcset=\"https:\/\/wp-space.de\/wp-content\/uploads\/2024\/04\/Datenbankname.png 355w, https:\/\/wp-space.de\/wp-content\/uploads\/2024\/04\/Datenbankname-300x36.png 300w, https:\/\/wp-space.de\/wp-content\/uploads\/2024\/04\/Datenbankname-18x2.png 18w\" sizes=\"(max-width: 355px) 100vw, 355px\" \/><\/figure>\n\n\n\n<p><strong>2. database user name<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"255\" height=\"40\" src=\"https:\/\/wp-space.de\/wp-content\/uploads\/2024\/04\/Datenbankusername.png\" alt=\"Database user name wp-config.php\" class=\"wp-image-28042\" srcset=\"https:\/\/wp-space.de\/wp-content\/uploads\/2024\/04\/Datenbankusername.png 255w, https:\/\/wp-space.de\/wp-content\/uploads\/2024\/04\/Datenbankusername-18x3.png 18w\" sizes=\"(max-width: 255px) 100vw, 255px\" \/><\/figure>\n\n\n\n<p><strong>3. database password<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"343\" height=\"42\" src=\"https:\/\/wp-space.de\/wp-content\/uploads\/2024\/04\/Datenbankpasswort.png\" alt=\"Database password wp-config.php\" class=\"wp-image-28041\" srcset=\"https:\/\/wp-space.de\/wp-content\/uploads\/2024\/04\/Datenbankpasswort.png 343w, https:\/\/wp-space.de\/wp-content\/uploads\/2024\/04\/Datenbankpasswort-300x37.png 300w, https:\/\/wp-space.de\/wp-content\/uploads\/2024\/04\/Datenbankpasswort-18x2.png 18w\" sizes=\"(max-width: 343px) 100vw, 343px\" \/><\/figure>\n\n\n\n<p><strong>4. host name of your database<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"299\" height=\"42\" src=\"https:\/\/wp-space.de\/wp-content\/uploads\/2024\/04\/Datenbankhostname.png\" alt=\"Database hostname wp-config.php\" class=\"wp-image-28040\" srcset=\"https:\/\/wp-space.de\/wp-content\/uploads\/2024\/04\/Datenbankhostname.png 299w, https:\/\/wp-space.de\/wp-content\/uploads\/2024\/04\/Datenbankhostname-18x3.png 18w\" sizes=\"(max-width: 299px) 100vw, 299px\" \/><\/figure>\n\n\n\n<p>In summary, the details of the database that the wp-config.php wants to access look something like this: <\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"563\" height=\"370\" src=\"https:\/\/wp-space.de\/wp-content\/uploads\/2024\/04\/Datenbankangabenwpconfig.png\" alt=\"Database wp-config.php\" class=\"wp-image-28044\" srcset=\"https:\/\/wp-space.de\/wp-content\/uploads\/2024\/04\/Datenbankangabenwpconfig.png 563w, https:\/\/wp-space.de\/wp-content\/uploads\/2024\/04\/Datenbankangabenwpconfig-300x197.png 300w, https:\/\/wp-space.de\/wp-content\/uploads\/2024\/04\/Datenbankangabenwpconfig-18x12.png 18w\" sizes=\"(max-width: 563px) 100vw, 563px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Instructions: Check and adjust the user data<\/h3>\n\n\n\n<p>To check the user data for correctness, you need access to:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Your wp-config.php, which is located in the root directory of your website<\/li>\n\n\n\n<li>The user data of the database of your WordPress website<\/li>\n<\/ul>\n\n\n\n<p><strong><b>Note \ud83d\udca1:<\/b> <\/strong>We'll show you how to customize the database user data in your hosting interface at WPspace. You don't need FTP access to do this.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">1. check the database details in wp-config.php<\/h4>\n\n\n\n<p>The first step is to copy the database data from wp-config.php so that you can compare it with the \"real data\" afterwards.<\/p>\n\n\n\n<p>Log in to the WordPress hosting of your website and navigate to \"Files\" via the left menu. You are now in the base directory of your website. <\/p>\n\n\n\n<p>By default, you will now select the \"httpdocs\" folder. There you will already find the necessary file \"wp-config.php\".<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"541\" src=\"https:\/\/wp-space.de\/wp-content\/uploads\/2024\/04\/image-1024x541.png\" alt=\"Website file directory\" class=\"wp-image-28154\" srcset=\"https:\/\/wp-space.de\/wp-content\/uploads\/2024\/04\/image-1024x541.png 1024w, https:\/\/wp-space.de\/wp-content\/uploads\/2024\/04\/image-300x158.png 300w, https:\/\/wp-space.de\/wp-content\/uploads\/2024\/04\/image-768x406.png 768w, https:\/\/wp-space.de\/wp-content\/uploads\/2024\/04\/image-18x10.png 18w, https:\/\/wp-space.de\/wp-content\/uploads\/2024\/04\/image.png 1289w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>Click on wp-config.php to open it. There you will find the \"Database settings\". Make sure you save the complete section on the database settings in a Word document or similar.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"590\" height=\"360\" src=\"https:\/\/wp-space.de\/wp-content\/uploads\/2024\/04\/DatabaseAngaben.png\" alt=\"Database details\" class=\"wp-image-28155\" srcset=\"https:\/\/wp-space.de\/wp-content\/uploads\/2024\/04\/DatabaseAngaben.png 590w, https:\/\/wp-space.de\/wp-content\/uploads\/2024\/04\/DatabaseAngaben-300x183.png 300w, https:\/\/wp-space.de\/wp-content\/uploads\/2024\/04\/DatabaseAngaben-18x12.png 18w\" sizes=\"(max-width: 590px) 100vw, 590px\" \/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\">2. check names and users of the database<\/h4>\n\n\n\n<p>After you have successfully copied the data from wp-config.php, the first step is to compare the name and user of the database.<\/p>\n\n\n\n<p>To do this, navigate to the menu item \"Databases\". If you have several databases here, scroll to the database with the name (DB_NAME) specified in wp-config.php.<\/p>\n\n\n\n<p>Now compare the DB_NAME and the DB_User with the information in the database. This is the cause in most cases.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"996\" height=\"270\" src=\"https:\/\/wp-space.de\/wp-content\/uploads\/2024\/04\/DatenbankUserundName.png\" alt=\"Compare database data\" class=\"wp-image-28157\" srcset=\"https:\/\/wp-space.de\/wp-content\/uploads\/2024\/04\/DatenbankUserundName.png 996w, https:\/\/wp-space.de\/wp-content\/uploads\/2024\/04\/DatenbankUserundName-300x81.png 300w, https:\/\/wp-space.de\/wp-content\/uploads\/2024\/04\/DatenbankUserundName-768x208.png 768w, https:\/\/wp-space.de\/wp-content\/uploads\/2024\/04\/DatenbankUserundName-18x5.png 18w\" sizes=\"(max-width: 996px) 100vw, 996px\" \/><\/figure>\n\n\n\n<p>\u2705 If these match, you do not need to adjust the DB_NAME and DB_USER in wp-config.php<\/p>\n\n\n\n<p><strong>\u274c If these do not match, this is the cause of the error on your website<\/strong><br>Then copy the name and user of the database that belongs to your website in your hosting interface into your Word document.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">3. check the database password<\/h4>\n\n\n\n<p>Next, we check the password and the host of the database. To do this, we navigate to the user administration in the \"Databases\" menu item.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"253\" src=\"https:\/\/wp-space.de\/wp-content\/uploads\/2024\/04\/DatenbankBenutzerverwaltung-1024x253.png\" alt=\"Database hosting\" class=\"wp-image-28160\" srcset=\"https:\/\/wp-space.de\/wp-content\/uploads\/2024\/04\/DatenbankBenutzerverwaltung-1024x253.png 1024w, https:\/\/wp-space.de\/wp-content\/uploads\/2024\/04\/DatenbankBenutzerverwaltung-300x74.png 300w, https:\/\/wp-space.de\/wp-content\/uploads\/2024\/04\/DatenbankBenutzerverwaltung-768x190.png 768w, https:\/\/wp-space.de\/wp-content\/uploads\/2024\/04\/DatenbankBenutzerverwaltung-18x4.png 18w, https:\/\/wp-space.de\/wp-content\/uploads\/2024\/04\/DatenbankBenutzerverwaltung.png 1395w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>There you will find an overview of all database users available in your hosting plan. Find the appropriate user again based on the information in wp-config.php. Click on the user.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"765\" height=\"836\" src=\"https:\/\/wp-space.de\/wp-content\/uploads\/2024\/04\/DatenbankdatenPruefen.png\" alt=\"Check database data\" class=\"wp-image-28161\" srcset=\"https:\/\/wp-space.de\/wp-content\/uploads\/2024\/04\/DatenbankdatenPruefen.png 765w, https:\/\/wp-space.de\/wp-content\/uploads\/2024\/04\/DatenbankdatenPruefen-275x300.png 275w, https:\/\/wp-space.de\/wp-content\/uploads\/2024\/04\/DatenbankdatenPruefen-11x12.png 11w\" sizes=\"(max-width: 765px) 100vw, 765px\" \/><\/figure>\n\n\n\n<p>The database server is specified in wp-config.php under 'DB_HOST'. <\/p>\n\n\n\n<p>Copy the password from the copied data and enter it here in the database user mask. Confirm with the \"Ok\" button.<\/p>\n\n\n\n<p>\u2705 If the DB_HOST in wp-config.php matches, no changes need to be made.<\/p>\n\n\n\n<p><strong>\u274c If the DB_HOST does not match, this is the cause of the error on your website<\/strong><br>Copy the DB_HOST into your Word document so that you can adjust it immediately in wp-config.php. <\/p>\n\n\n\n<h4 class=\"wp-block-heading\">4. adjust data in the wp-config.php<\/h4>\n\n\n\n<p><b>Note \ud83d\udca1:<\/b>  This step is only necessary if the data in the database user and the wp-config.php do not match.<\/p>\n\n\n\n<p>Navigate back to your httpdocs folder via \"Files\". Open the wp-config here. <\/p>\n\n\n\n<p>Now replace the incorrect data with the correct data from the database and confirm with \"Save\".<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">5. test website<\/h4>\n\n\n\n<p>After you have made the adjustment in wp-config.php, you should be able to access your website normally again. If the error persists, I recommend that you test the next recommended methods!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Deleted database<\/h2>\n\n\n\n<p>Have you just noticed during testing that your database no longer exists? Then this is one reason for the error when calling up your website.<\/p>\n\n\n\n<p>Without the database, WordPress cannot access any data. And therefore cannot display any data. <\/p>\n\n\n\n<p>To fix the error, I recommend that you restore a backup of your database. Have you not created your own backups? Then check whether your host regularly creates backups for you.<\/p>\n\n\n\n<p>WPspace creates daily backups of your website, which are available to you for 14 days. Simply select the most recent backup and restore it. If there is still no database, select the next older backup from the overview and continue in this way.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Repairing a damaged database <\/h2>\n\n\n\n<p>It is very unlikely that your database or the table it contains is damaged. However, this can happen in rare exceptional cases. <\/p>\n\n\n\n<p>A connection to your database is established when your website is called up. An error occurs when trying to read and export the tables\/data from the database. As a result, your website cannot be displayed. <\/p>\n\n\n\n<p>If you have experienced this rare case, you have the following three options for repairing your database.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Repair database via the hosting interface<\/h3>\n\n\n\n<p>As WPspace and therefore <a href=\"https:\/\/wp-space.de\/en\/managed-shared-wordpress-hosting\/\">Managed WordPress hosting<\/a> As a WPspace customer, the \"Check and repair database\" function is available natively in the hosting interface. This tool saves you complicated detours and you can also check in the first step whether there is a damaged database at all. It's that easy to check and repair your database:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Log in to your <a href=\"https:\/\/help.wpspace.de\/de\/articles\/9183562-login-hosting-oberflache\" target=\"_blank\" rel=\"noopener\">Hosting interface at WPspace<\/a> a<\/li>\n\n\n\n<li>Navigate to the menu item \"Databases\"<\/li>\n\n\n\n<li>In the overview, click on \"Check and repair\" in the submenu of the database that belongs to your website<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"721\" height=\"260\" src=\"https:\/\/wp-space.de\/wp-content\/uploads\/2024\/05\/Ueberpruefenundreparieren.png\" alt=\"Check and repair function\" class=\"wp-image-28371\" srcset=\"https:\/\/wp-space.de\/wp-content\/uploads\/2024\/05\/Ueberpruefenundreparieren.png 721w, https:\/\/wp-space.de\/wp-content\/uploads\/2024\/05\/Ueberpruefenundreparieren-300x108.png 300w, https:\/\/wp-space.de\/wp-content\/uploads\/2024\/05\/Ueberpruefenundreparieren-18x6.png 18w\" sizes=\"(max-width: 721px) 100vw, 721px\" \/><\/figure>\n\n\n\n<p>\u2705 Do you receive a<strong> Success message \"Database has no errors\"<\/strong> your database is not damaged. You therefore do not need to repair the database. A damaged database is not the cause of the error message \"Error establishing a database connection\".<\/p>\n\n\n\n<p>\u274c Do you receive <strong>No success message<\/strong>your database is damaged. The native function will then automatically repair your database for you. <\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"datenbank-reparieren-uber-phpmyadmin\">Repair database via phpMyAdmin<\/h3>\n\n\n\n<p>If the \"Repair database\" function is not natively available in your hosting, you can also carry out the steps via phpMyAdmin. How to repair your website's database via phpMyAdmin:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"797\" src=\"https:\/\/wp-space.de\/wp-content\/uploads\/2024\/05\/DatenbankreparierenPHP-1024x797.png\" alt=\"Repair database phpMyAdmin\" class=\"wp-image-28372\" srcset=\"https:\/\/wp-space.de\/wp-content\/uploads\/2024\/05\/DatenbankreparierenPHP-1024x797.png 1024w, https:\/\/wp-space.de\/wp-content\/uploads\/2024\/05\/DatenbankreparierenPHP-300x234.png 300w, https:\/\/wp-space.de\/wp-content\/uploads\/2024\/05\/DatenbankreparierenPHP-768x598.png 768w, https:\/\/wp-space.de\/wp-content\/uploads\/2024\/05\/DatenbankreparierenPHP-15x12.png 15w, https:\/\/wp-space.de\/wp-content\/uploads\/2024\/05\/DatenbankreparierenPHP.png 1268w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Access your database via phpMyAdmin <\/li>\n\n\n\n<li>Check the \"Select all\" box to automatically select all tables<\/li>\n\n\n\n<li> Open the \"marked\" drop-down menu <\/li>\n\n\n\n<li>Select \"Repair table\" <\/li>\n\n\n\n<li>The SQL command is now executed automatically. <\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"datenbank-reparieren-uber-wordpress\">Repair database via WordPress<\/h3>\n\n\n\n<p>Alternatively, you can also repair your database via WordPress. In my opinion, this is the most complex way. With the following instructions, you can also do this without any problems: <\/p>\n\n\n\n<p><strong>1. access your main directory: <br><\/strong>Access the main directory of your WordPress website either directly via your hosting interface or via FTP access <\/p>\n\n\n\n<p><strong>2. open the wp-config.php<br><\/strong>In the root directory \/ main directory of your websites you will find the file \"wp-config.php\". Open this file.<\/p>\n\n\n\n<p><b>Note \ud83d\udca1:<\/b>  Depending on the host, it may be necessary to download wp-config.php and upload it again after customization. You can then save the TXT file locally on your PC using programs such as <a href=\"https:\/\/notepad-plus-plus.org\/\" target=\"_blank\" rel=\"noopener\">Notepad++<\/a> (recommendation) or <a href=\"https:\/\/www.sublimetext.com\/\" target=\"_blank\" rel=\"noopener\">Sublime Text <\/a>edit.<\/p>\n\n\n\n<p><strong>3. add a line of code<\/strong><\/p>\n\n\n\n<p>Enter the following line of code in wp-config.php:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>define('WP_ALLOW_REPAIR', true);<\/code><\/pre>\n\n\n\n<p><strong>4. call up the WordPress database repair page<\/strong><br>You can call up the repair page for the WordPress database with the following prefix: \/wp-admin\/maint\/repair.php<\/p>\n\n\n\n<p>In summary, the link looks something like this: <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>https:\/\/deinedomain.de\/wp-admin\/maint\/repair.php<\/code><\/pre>\n\n\n\n<p><strong>Important: <\/strong>Exchange deinedomain.de with your actual own domain.<\/p>\n\n\n\n<p><strong>5. repair database<\/strong><br>After you have clicked on the link, the WordPress repair page will appear. Here you click on the \"Repair database\" button. WordPress will now automatically repair your database for you.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"754\" height=\"401\" src=\"https:\/\/wp-space.de\/wp-content\/uploads\/2024\/05\/DatenbankreparierenWordPress.png\" alt=\"\" class=\"wp-image-28377\" srcset=\"https:\/\/wp-space.de\/wp-content\/uploads\/2024\/05\/DatenbankreparierenWordPress.png 754w, https:\/\/wp-space.de\/wp-content\/uploads\/2024\/05\/DatenbankreparierenWordPress-300x160.png 300w, https:\/\/wp-space.de\/wp-content\/uploads\/2024\/05\/DatenbankreparierenWordPress-18x10.png 18w\" sizes=\"(max-width: 754px) 100vw, 754px\" \/><\/figure>\n\n\n\n<p><strong>6. remove code line<br><\/strong>Navigate back to your wp-config.php. Search here for your added line (the easiest way to do this is to use CTRL+F and insert \"define('WP_ALLOW_REPAIR', true);\"). Delete the line from the file and save the updated wp-config.php.<\/p>\n\n\n\n<p><strong>7. check website<br><\/strong>Call up your website in the Incognito tab and check whether the error \"Error establishing a database connection\" has been fixed.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Check the accessibility of your database server<\/h2>\n\n\n\n<p>There are factors over which you generally have no direct influence. These include the accessibility of your host's database server.<\/p>\n\n\n\n<p>If you are looking for a <a href=\"https:\/\/wp-space.de\/en\/\">Reliable WordPress hosters like WPspace<\/a> this usually happens very rarely or not at all. WPspace had an annual average availability of 99.9 % in 2024! \ud83d\ude80<\/p>\n\n\n\n<p>However, if you suspect that your hosting's database server is the cause of the error message, you have various options for determining the accessibility of the database server.<\/p>\n\n\n\n<p><b>Note \ud83d\udca1:<\/b> The database server may be unavailable and the \"main server\" that runs your hosting is available. <\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Check the status page of the hoster<\/strong><br>A status page is used to keep customers up to date on current outages, restrictions and maintenance work. A professional hoster always keeps this overview up to date. <br>You can find all information about the status at WPspace via this link: <a href=\"https:\/\/wpspace.statuspage.io\/\" target=\"_blank\" rel=\"noopener\">WPspace Status (statuspage.io)<\/a><br><strong>Tip: <\/strong>It is often possible to be automatically informed of updates by e-mail. <\/li>\n\n\n\n<li><strong>Contact the hoster's support<br><\/strong>If you do not know the link to the hoster's status page, you can also contact the hoster's support team directly by phone, email or via support chat. <\/li>\n\n\n\n<li><strong>Login to database<br><\/strong>Try to access the database directly via your hosting interface or alternatively via phpMyAdmin. Can't access the database? Then it may be that the database server is not accessible.<\/li>\n\n\n\n<li><strong>Call up alternative page<\/strong><br>Do you have a second page on the same server? Then try calling it up. If the website also shows you the error \"Error establishing a database connection\", this confirms the assumption that the database server is not accessible.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Import current backup<\/h2>\n\n\n\n<p>I recommend that you only import a backup if the cause is still unknown to you and you have no other solution. The following tips and information on importing the backup: <\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Create a backup before you import your old backup: <br><\/strong>When making such major changes, you should always first carry out a complete <a href=\"https:\/\/wp-space.de\/en\/create-wordpress-backup\/\">Create WordPress backup<\/a>. <\/li>\n\n\n\n<li><strong>Start with the latest backup:<br><\/strong>If you are unsure about how long the error has existed on your website, start with the most recent backup. If the error persists after that, import the next older backup.<\/li>\n\n\n\n<li><strong>Data loss: <\/strong><br>When you import the backup, you overwrite all the changes that have been made since then. This can be a big problem, especially for stores. <\/li>\n\n\n\n<li><strong>Import database backup:<br><\/strong>Depending on the backup, you may only have the option of importing a backup of your database. Start with this, as this may already solve your problem.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion on the error \"Error establishing a database connection\"<\/h2>\n\n\n\n<p>The error \"Error establishing a database connection\" occurs rarely. There are various reasons why the error can occur: <\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Incorrect database information in wp-config.php<\/li>\n\n\n\n<li>Deleted database<\/li>\n\n\n\n<li>Damaged database<\/li>\n\n\n\n<li>Database server not accessible<\/li>\n<\/ul>\n\n\n\n<p>The most common cause is incorrect database information in wp-config.php. I therefore recommend that you check this information first. If that doesn't help, you can try to repair the database or ask your host for help. <\/p>\n\n\n\n<p><b>Pro tip for WPspace customers\ud83d\udc99:<\/b> Is your website displaying the error? Then contact our support chat so that we can help you fix the error! Our technical team will be happy to check possible causes for you and provide you with tips.<\/p>\n\n\n\n<p>If you are at a loss, you can import a backup of your website. Please note that this may result in data loss! So create another backup beforehand. <\/p>","protected":false},"excerpt":{"rendered":"<p>Beim Aufrufen deiner WordPress Website erh\u00e4ltst du einen White Screen of Death mit der Fehlermeldung &#8222;Fehler beim Aufbau einer Datenbankverbindung&#8220;? Das ist einer der h\u00e4ufigsten Fehler auf Websites und l\u00e4sst sich (in der Regel) schnell beheben. Also keine Sorge: Mit dieser Anleitung erf\u00e4hrst du Schritt f\u00fcr Schritt, wie du den Fehler &#8222;Fehler beim Aufbau einer [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":29777,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[84,92],"tags":[],"class_list":["post-28024","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-wordpress-grundlagen","category-tipps-tutorials"],"_links":{"self":[{"href":"https:\/\/wp-space.de\/en\/wp-json\/wp\/v2\/posts\/28024","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wp-space.de\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wp-space.de\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wp-space.de\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/wp-space.de\/en\/wp-json\/wp\/v2\/comments?post=28024"}],"version-history":[{"count":1,"href":"https:\/\/wp-space.de\/en\/wp-json\/wp\/v2\/posts\/28024\/revisions"}],"predecessor-version":[{"id":55729,"href":"https:\/\/wp-space.de\/en\/wp-json\/wp\/v2\/posts\/28024\/revisions\/55729"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wp-space.de\/en\/wp-json\/wp\/v2\/media\/29777"}],"wp:attachment":[{"href":"https:\/\/wp-space.de\/en\/wp-json\/wp\/v2\/media?parent=28024"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wp-space.de\/en\/wp-json\/wp\/v2\/categories?post=28024"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wp-space.de\/en\/wp-json\/wp\/v2\/tags?post=28024"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}