Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+2 votes
8.8k views
in Q2A Core by

I discovered the following in my error logs multiple times:

PHP Warning:  mysqli::mysqli(): (HY000/2002): php_network_getaddresses: getaddrinfo failed: Name or service not known in qa-include/qa-db.php on line 66


LINE 66:

   $db = new mysqli(QA_FINAL_MYSQL_HOSTNAME, QA_FINAL_MYSQL_USERNAME, QA_FINAL_MYSQL_PASSWORD, QA_FINAL_MYSQL_DATABASE);

I once got:

PHP Question2Answer MySQL connect error 2002: php_network_getaddresses: getaddrinfo failed: Name or service not known


Could it be that the DB was down? Or is it something else?

Research on the net brought up:
- http://stackoverflow.com/a/12381661/1066234
- http://stackoverflow.com/a/18161795/1066234
- http://stackoverflow.com/a/22436588/1066234

Q2A version: 1.7.4
by
I face the same error on my site.
If you find out what is causing it, let me know, please.

My site is unavailable usually every hour for a few minutes.

1 Answer

0 votes
by

This page suggests it could be something at the server level, which you'd need to check with your host about.

Otherwise yes it must be some issue with the MySQL server not working sometimes.

...