gpt4 book ai didi

mysql - Kubernetes上安装MySQL和WordPress未连接数据库

转载 作者:行者123 更新时间:2023-11-29 20:51:27 25 4
gpt4 key购买 nike

我用了this github repository创建一个 Wordpess,但我有一个问题:

部署后,查看日志wordPress提示未连接数据库:

[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

docker-compose连接数据库有Linx字段,但是这个字段下面没有k8s,如何找到主机名MySQL?

docker-compose.yaml

links:
- db:mysql

最佳答案

请检查 wp-config 文件以获得正确的数据库名称和用户详细信息

关于mysql - Kubernetes上安装MySQL和WordPress未连接数据库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38010884/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com