0

I'm trying out Laravel Sail for the first time and it's been a really bumpy road, likely through no fault of the package. I'm having an issue with either being able to access my test site, or migrate the database.

  • To access the test site, I need my DB_HOST set to mysql.
    • However, I cannot run a migration, getting php_network_getaddresses: getaddrinfo failed: nodename nor servname provided when trying.
  • To migrate the database, I need my DB_HOST set to 127.0.0.1.
    • However, I cannot access the site, getting Connection Refused even if setting DB_HOST to localhost.

I'm working off a mid-2012 macbook pro that has seen Valet with all it's brew requirements, various Homestead boxes, and various other tinkering, and while I believe I've turned off any other services running, I can only imagine this has something to do with that?

Chords
  • 6,720
  • 2
  • 39
  • 61

2 Answers2

0

Got this sorted and it's a case of RTFM.

DB_HOST=mysql is correct, I was not using sail to run artisan, and was instead running it against my locally installed php instance. Setting an alias and running sail artisan migrate:refresh is working as I would expect, as is the app.

Chords
  • 6,720
  • 2
  • 39
  • 61
0

Make sure you are running sail artisan migrate and the like when running commands, instead of using php.

See the docs here

damask
  • 529
  • 4
  • 17