My Laravel 5 has run OK until the database was configured, then found this error:
SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name o
In config/database.php
I changed the default DB connection from mysql to sqlite. I deleted the .env
file (actually renamed it) and created the sqlite file with touch storage/database.sqlite
. The migration worked with sqlite.
Then I switched back the config/database.php
default DB connection to mysql and recovered the .env
file. The migration worked with mysql.
It doesn't make sense I guess. Maybe was something serverside.