WordPress error :: Error establishing a database connection

Collapse

Unconfigured Ad Widget

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Marc_AccuWebHosting
    Member
    • Jun 2015
    • 56

    WordPress error :: Error establishing a database connection

    Problem Statement

    Could not access WordPress Website or WordPress dashboard.

    Error Statement

    Error establishing a database connection

    Solution

    Normally this error occurs when WordPress is unable to establish a database connection. There are many possible reasons why WordPress is unable to establish a database connection. Following are some possible suggestions to troubleshoot this problem.
    1. Make sure you are using correct WordPress database username and password in wp-config.php file. It is possible that login credentials are wrong or recently changed.
    2. Make sure that your database server is responsive and working fine.
    3. When you are unable to access WordPress website and Dashboard, most probably WordPress database is corrupted. You can repair WordPress database with few easy steps. You will have to add following lines in your wp-config.php file:
    define('WP_ALLOW_REPAIR', true);

    Once you have done that, browse the wp-admin again, it will repair the database .
    Last edited by Marc_AccuWebHosting; 06-09-2015, 10:01 PM.
  • kumkum sharma
    Junior Member
    • Aug 2020
    • 7

    #2
    Hi,
    I checked your provided information is amazing and help lot of people.
    I just want to add if anyone is using cpanel and then he/she face "Error establishing a database connection" error in Wordpress website.
    For that you can follow below steps:
    - Login to cpanel
    - Click on MySQL databases
    - Give that user all the priviledges of data bases.
    - It is must to have priviledges to user, so check this and then try again to access.

    Comment

    • Andyrson
      Junior Member
      • Mar 2021
      • 1

      #3

      Hey. I recently started getting this error and unfortunately, your suggestions haven't helped much. I also use employee monitoring software with window hosting.
      Can smth be affecting the wordpress?

      Last edited by admin; 03-13-2021, 06:19 AM.

      Comment

      • adviseseo
        Junior Member
        • Jan 2021
        • 1

        #4
        AccuWeb.Cloud
        Hi,

        I was updating new plugins on my WordPress blog. Now it Stuck in Maintenance Mode. Please help.

        Comment

        Working...
        X