I've got this error:
SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: nodename nor servname provided, or not known
and
PDO::__construct(): php_network_getaddresses: getaddrinfo failed: nodename nor servname provided, or not known.
When I try to run php artisan serve in terminal I got always same error. did anyone already solved this Problem ?
I use Xampp on Mac.
This's my database.php.
'mysql' => [
'driver' => 'mysql',
'host' => env('DB_HOST', 'localhostphp artisan make:migration create_users_table'),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
'strict' => false,
'engine' => null,
],
and this one is my env.
DB_CONNECTION=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=-----
DB_USERNAME=------
DB_PASSWORD=------
I got this two error. since 2 week I try to solve a problem. but I could't find solution. I've already done all solution on stackoverflow.
Thaks For Your Help.
127.0.0.1 localhost
set in your/etc/hosts
file? – matticustard127.0.0.1 localhost
exists in your/etc/hosts
file to bind that IP to localhost. It should exist and be uncommented. – matticustard