在 Homestead 中报错:SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution
1、在 Homestead 中报错:SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution。如图1
SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution (SQL: select * from `products` where `id` in (4, 5, 6, 7, 8, 9, 10, 12, 13, 14, 15, 16, 17, 18, 19, 20) order by FIND_IN_SET(id, '4,5,6,7,8,9,10,12,13,14,15,16,17,18,19,20'))
2、编辑 .env 文件,DB_HOST=mysql 修改为 DB_HOST=127.0.0.1。不再报错。
近期评论