I have a question same like this post Failed to connect to your database server . I try follow this post method to solve, but it doesn’t work for me. Hope some one can guide me on how to solve this problem. Thanks.
sites/default/setting.php
$databases['default']['default'] = array ( 'database' => 'jango9_release', 'username' => 'root', 'password' => '', 'prefix' => '', 'host' => 'localhost', 'port' => '3306', 'namespace' => 'Drupal\Core\Database\Driver\mysql', 'driver' => 'mysql', );
My username is root and password is empty.
The error:
DATABASE SETTINGS Resolve all issues below to continue the installation. For help configuring your database server, see the installation handbook, or contact your hosting provider. Failed to connect to your database server. The server reports the following message: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: No such host is known. . Is the database server running? Does the database exist or does the database user have sufficient privileges to create the database? Have you entered the correct database name? Have you entered the correct username and password? Have you entered the correct database hostname and port number?
And the errors show:
The website encountered an unexpected error. Please try again later. PDOException: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: No such host is known. in DrupalComponentDependencyInjectionPhpArrayContainer->createService() (line 79 of C:xampphtdocsDrupal_9webcorelibDrupalComponentDependencyInjectionPhpArrayContainer.php). DrupalComponentDependencyInjectionPhpArrayContainer->createService(Array, 'database') (Line: 176) DrupalComponentDependencyInjectionContainer->get('database', 1) (Line: 212) DrupalComponentDependencyInjectionPhpArrayContainer->resolveServicesAndParameters(Array) (Line: 62) DrupalComponentDependencyInjectionPhpArrayContainer->createService(Array, 'cache.container') (Line: 176) DrupalComponentDependencyInjectionContainer->get('cache.container') (Line: 549) DrupalCoreDrupalKernel->getCachedContainerDefinition() (Line: 894) DrupalCoreDrupalKernel->initializeContainer() (Line: 472) DrupalCoreDrupalKernel->boot() (Line: 707) DrupalCoreDrupalKernel->handle(Object) (Line: 19)