There is no problem not worth solving, and no technology not worth learning!

Error in Homestead: sqlstate[HY000][2002]PHP_Network_GetAddresses: GetAddrinfo Failed: Temporary Failure in Name Resolution

在 Homestead 中报错:SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution

1. Error in Homestead: sqlstate[HY000][2002]php_network_getaddresses: getaddrinfo failed: temporary failure in name resolution. as shown in Figure 1

在 Homestead 中报错:SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution
Figure 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. Edit the .env file, and db_host=mysql modify it to db_host=127.0.0.1. No more errors.

Need long-term technical maintenance or remote troubleshooting?

I am a PHP / Go backend engineer with 15+ years of experience, focused on existing system maintenance, bug fixing, performance optimization, server troubleshooting, WordPress maintenance, and small feature iterations.

If your project is facing any of the following issues, we can start with a small troubleshooting task first:

  • ✅ PHP / Laravel / Yii2 legacy systems without active maintenance
  • ✅ Go / Gin backend APIs that need troubleshooting or optimization
  • ✅ Slow, broken, or unstable WordPress websites
  • ✅ Nginx / MySQL / Redis / Linux server issues
  • ✅ CDN / Cloudflare / DNS / HTTPS configuration problems
  • ✅ Long-term remote technical support or part-time maintenance

More details: About Me & Collaboration

WeChat: 13980074657
Email: shuijingwanwq@gmail.com
Telegram: @shuijingwan
GitHub: https://github.com/shuijingwan

评论

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.