SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known

前端 未结 16 774
说谎
说谎 2021-01-03 17:56

I download from https://github.com/luciddreamz/laravel Laravel for openshift then upload over my repository over github. This code for connect to database not work. The prob

16条回答
  •  独厮守ぢ
    2021-01-03 18:42

    In my case, when laravel generated the .env configuration file, laravel also generated two uncommented "DB_HOST" lines at line 11 and 12, delete the one that says "mysql" and uncomment (if yours it's commented) the other one (the one with the localhost ip 127.0.0.1) and it worked. (In my case).

    Have a great day

提交回复
热议问题