Installation of MySQL and WordPress on Kubernetes not connected to the database

6/24/2016

I used this github repository to create a Wordpess, but I have a question:

After the deployment, view logs wordPress tips are not connected to the database:

[root@master k11]# kubectl logs wordpress WordPress not found in /var/www/html - copying now... WARNING: /var/www/html is not empty - press Ctrl+C now if this is an error!

ls -A .htaccess
sleep 10 Complete! WordPress has been successfully copied to /var/www/html

Warning: mysqli::mysqli(): php_network_getaddresses: getaddrinfo failed: Name or service not known in - on line 10

Warning: mysqli::mysqli(): (HY000/2002): php_network_getaddresses: getaddrinfo failed: Name or service not known in - on line 10

MySQL Connection Error: (2002) php_network_getaddresses: getaddrinfo failed: Name or service not known

Warning: mysqli::mysqli(): php_network_getaddresses: getaddrinfo failed: Name or service not known in - on line 10

The docker-compose connection database has the Linx field, but there is no k8s below this field, how to find the hostname MySQL?

docker-compose.yaml

links:
- db:mysql
-- zhanghonged
kubernetes
mysql
wordpress

1 Answer

6/24/2016

Please check wp-config file for proper Database name and user details

-- akeepanchal31
Source: StackOverflow