Error establishing a database connection

[ad_1]

​

No changes other than maybe an automatic upgrade and recently getting a database error connection. I can reach the database and the credentials are still valid in the wp-config. Where else do the credentials need to go?

class-wpdb.php

mysqli\_real\_connect(): (HY000/2002): Host is unreachable in /config/www/wordpress/wp-includes/class-wpdb.php on line 2019

Lines

763 $this->dbuser = $dbuser;

764 $this->dbpassword = $dbpassword;

765 $this->dbname = $dbname;

766 $this->dbhost = $dbhost;

​

2018 if ( WP\_DEBUG ) {

2019 mysqli\_real\_connect( $this->dbh, $host, $this->dbuser, $this->dbpassword, null, $port, $socket, $client\_flags );

2020 } else {

2021 // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged

2022 u/mysqli_real_connect( $this->dbh, $host, $this->dbuser, $this->dbpassword, null, $port, $socket, $client\_flags );

2023 }

[ad_2]

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer