Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo for mysql failed: Temporary failure in name resolution #687

Closed
cage81 opened this issue Mar 29, 2024 · 1 comment

Comments

@cage81
Copy link

cage81 commented Mar 29, 2024

Sail Version

1.29

Laravel Version

11.1.1

PHP Version

8.3.4

Operating System

Windows (WSL)

OS Version

Ubuntu 22.04

Description

On a fresh Laravel 11 installation, the main page is not reachable showing the following error:

image

It coulb be a bug, the reasolution I found un an old post is to change the .env file adding this line:

DB_HOST=host.docker.internal

I changed the following things in the docker-compose.yml before the sail build command:

service name form laravel.locale to project-name.locale
laravel service port from 80 to 8280
mysql service name from mysql to projectname-mysql*

Steps To Reproduce

  • Install a fresh Laravel project with the following command:
composer create-project laravel/laravel:^11.0 project-name
  • Install sail inside project-name directory using the following commands:
composer require laravel/sail --dev
php artisan sail:install
sail up -d
@driesvints
Copy link
Member

Using your exact steps, together with sail artisan migrate, I get a running Laravel app. Most likely this was a temp hiccup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants