Laravel9 を マニュアルに沿ってインストール
php artisan migrate
すると以下のエラーが発生(WinでもMacでも)
SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo for mysql failed: nodename nor servname provided, or not known (SQL: select * from information_schema.tables where table_schema = example_app and table_name = migrations and table_type = 'BASE TABLE')
.env の
DB_HOST=mysql
をいかに変更してリトライ
DB_HOST=localhost
すると、以下のエラーに
SQLSTATE[HY000] [2002] No such file or directory (SQL: select * from information_schema.tables where table_schema = example_app and table_name = migrations and table_type = 'BASE TABLE')
さらに
DB_HOST=127.0.0.1
としてリトライしたら成功!