• Occasionally, my website will experience an “Error establishing a database connection,” where the error page specifically cites line 1531 in wp-includes/wp-db.php: https://i.imgur.com/zXoaCx3.png

    This is what that line is:
    mysqli_real_connect( $this->dbh, $host, $this->dbuser, $this->dbpassword, null, $port, $socket, $client_flags );

    And the whole block of code it’s a part of:

    if ( WP_DEBUG ) {
    				mysqli_real_connect( $this->dbh, $host, $this->dbuser, $this->dbpassword, null, $port, $socket, $client_flags );
    			} else {
    				@mysqli_real_connect( $this->dbh, $host, $this->dbuser, $this->dbpassword, null, $port, $socket, $client_flags );
    			}

    I’m not seeing what the issue could be, which is why I’m wondering if this page occurs when there’s a problem with my hosting server and not something to do with the database settings. When this error happens, it’ll usually last about 5-10 minutes before my website returns to normal.

    It’s been happening infrequently now; maybe once or twice per 2 weeks. If it’s any help, when the error happened earlier, I got a similar database error when trying to access my website’s forums based on XenForo software: https://i.imgur.com/K5gXb9t.png

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    My bet is that your host’s mysql server is occasionally getting overloaded. Please contact your host and ask them to check their server logs.

    Thread Starter Reggy

    (@fluxwavez)

    I see, so it probably is on my hosting provider’s end after all. Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘“Error establishing a database connection” from wp-db.php’ is closed to new replies.