summaryrefslogtreecommitdiff
path: root/www/posts/laravel/2020-12-14/sqlstate-hy000-2002-php-network-getaddresses-getaddrinfo-failed/index.html
diff options
context:
space:
mode:
Diffstat (limited to 'www/posts/laravel/2020-12-14/sqlstate-hy000-2002-php-network-getaddresses-getaddrinfo-failed/index.html')
-rw-r--r--www/posts/laravel/2020-12-14/sqlstate-hy000-2002-php-network-getaddresses-getaddrinfo-failed/index.html33
1 files changed, 19 insertions, 14 deletions
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 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed</title>
<link rel="shortcut icon" href="/images/favicon.png">
+ <link rel="stylesheet" href="/css/modern-normalize.min.css">
+ <link rel="stylesheet" href="/css/highlight.min.css">
+ <link rel="stylesheet" href="/css/railscasts.css">
<link rel="stylesheet" href="/css/site.css">
<link href="/posts/atom.xml" type="application/atom+xml" rel="alternate" title="The Home of David T. Sadler - All Posts"/>
<link href="/posts/arch/atom.xml" type="application/atom+xml" rel="alternate" title="The Home of David T. Sadler - All Posts About Arch"/>
@@ -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-&gt;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-&gt;prepareBindings($bindings), $e
+ 680▕ );
+ 681▕ }
+ 682▕
-+33 vendor frames
-34 artisan:37
-Illuminate\Foundation\Console\Kernel::handle()</code></pre><p>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.</p><p>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.</p><p>To resolve the issue just change the value back to 127.0.0.1</p><pre><code class="shell">DB_HOST=127.0.0.1</code></pre><h3>Links</h3><a href="https://github.com/laravel/laravel/commit/a895748980b3e055ffcb68b6bc1c2e5fad6ecb08#diff-a3046da0d15a27e89f2afe639b25748a7ad4d9290af3e7b1b6c1a5533c8f0a8cL11">Commit that changed .env.example.</a><a href="https://laravel.com/docs/8.x/sail/">Laravel Sail</a><a href="/posts/larvel/">Laravel - Read More Posts.</a><p>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.</p><a href="mailto:david@davidtsadler.com">Email david@davidtsadler.com</a><a href="https://creativecommons.org/licenses/by-sa/4.0/">The contents of this site is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.</a><p>Copyright © 2021 David T. Sadler.</p><a href="/">Return to Homepage.</a></section>
+ +33 vendor frames
+ 34 artisan:37
+ Illuminate\Foundation\Console\Kernel::handle()</code></pre><p>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.</p><p>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.</p><p>To resolve the issue just change the value back to 127.0.0.1</p><pre><code class="shell">DB_HOST=127.0.0.1</code></pre><h3>Links</h3><a href="https://github.com/laravel/laravel/commit/a895748980b3e055ffcb68b6bc1c2e5fad6ecb08#diff-a3046da0d15a27e89f2afe639b25748a7ad4d9290af3e7b1b6c1a5533c8f0a8cL11">Commit that changed .env.example.</a><a href="https://laravel.com/docs/8.x/sail/">Laravel Sail</a><a href="/posts/larvel/">Laravel - Read More Posts.</a><p>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.</p><a href="mailto:david@davidtsadler.com">Email david@davidtsadler.com</a><h3>License</h3><a href="https://creativecommons.org/licenses/by-sa/4.0/">The contents of this site is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.</a><p>Copyright © 2021 David T. Sadler.</p><a href="/">Return to Homepage.</a></section>
+ <script src="/js/highlight.min.js"></script>
+ <script src="/js/site.js"></script>
</body>
</html>