From 62243cd0b5262e14df7e7b5b7103b5b2e006cab5 Mon Sep 17 00:00:00 2001 From: "David T. Sadler" Date: Wed, 19 May 2021 23:46:22 +0100 Subject: Add more to css --- .../index.html | 33 +++++++++++++--------- 1 file changed, 19 insertions(+), 14 deletions(-) (limited to 'www/posts/laravel/2020-12-14/sqlstate-hy000-2002-php-network-getaddresses-getaddrinfo-failed/index.html') diff --git a/www/posts/laravel/2020-12-14/sqlstate-hy000-2002-php-network-getaddresses-getaddrinfo-failed/index.html b/www/posts/laravel/2020-12-14/sqlstate-hy000-2002-php-network-getaddresses-getaddrinfo-failed/index.html index 0cb27d1..88ed736 100644 --- a/www/posts/laravel/2020-12-14/sqlstate-hy000-2002-php-network-getaddresses-getaddrinfo-failed/index.html +++ b/www/posts/laravel/2020-12-14/sqlstate-hy000-2002-php-network-getaddresses-getaddrinfo-failed/index.html @@ -5,6 +5,9 @@ SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed + + + @@ -22,21 +25,23 @@ Illuminate\Database\QueryException -SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution (SQL: select * from information_schema.tables where table_schema = testsite and table_name = migrations and table_type = 'BASE TABLE') + SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution (SQL: select * from information_schema.tables where table_schema = testsite and table_name = migrations and table_type = 'BASE TABLE') -at vendor/laravel/framework/src/Illuminate/Database/Connection.php:678 -674▕ // If an exception occurs when attempting to run a query, we'll format the error -675▕ // message to include the bindings with SQL, which will make this exception a -676▕ // lot more helpful to the developer instead of just the database's errors. -677▕ catch (Exception $e) { -678▕ throw new QueryException( -679▕ $query, $this->prepareBindings($bindings), $e -680▕ ); -681▕ } -682▕ + at vendor/laravel/framework/src/Illuminate/Database/Connection.php:678 + 674▕ // If an exception occurs when attempting to run a query, we'll format the error + 675▕ // message to include the bindings with SQL, which will make this exception a + 676▕ // lot more helpful to the developer instead of just the database's errors. + 677▕ catch (Exception $e) { + 678▕ throw new QueryException( + 679▕ $query, $this->prepareBindings($bindings), $e + 680▕ ); + 681▕ } + 682▕ -+33 vendor frames -34 artisan:37 -Illuminate\Foundation\Console\Kernel::handle()

The cause of this issue is due to a change introduced to the .env.example file. This changed the environment variable DB_HOST from 127.0.0.1 to mysql. The reason for this change is to support [Laravel Sail](https://laravel.com/docs/8.x/sail) which is a Docker development environment for Laravel.

The change means your Laravel application will try and connect to a database server with the hostname of mysql. Unless this exists then the application can't connect.

To resolve the issue just change the value back to 127.0.0.1

DB_HOST=127.0.0.1

Links

Commit that changed .env.example.Laravel SailLaravel - Read More Posts.

I don't have comments as I don't want to manage them. You can however contact me at the below address if you want to.

Email david@davidtsadler.comThe contents of this site is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Copyright © 2021 David T. Sadler.

Return to Homepage. + +33 vendor frames + 34 artisan:37 + Illuminate\Foundation\Console\Kernel::handle()

The cause of this issue is due to a change introduced to the .env.example file. This changed the environment variable DB_HOST from 127.0.0.1 to mysql. The reason for this change is to support [Laravel Sail](https://laravel.com/docs/8.x/sail) which is a Docker development environment for Laravel.

The change means your Laravel application will try and connect to a database server with the hostname of mysql. Unless this exists then the application can't connect.

To resolve the issue just change the value back to 127.0.0.1

DB_HOST=127.0.0.1

Links

Commit that changed .env.example.Laravel SailLaravel - Read More Posts.

I don't have comments as I don't want to manage them. You can however contact me at the below address if you want to.

Email david@davidtsadler.com

License

The contents of this site is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

Copyright © 2021 David T. Sadler.

Return to Homepage. + + -- cgit v1.2.3-13-gbd6f