Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/72.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用Wordpress从docker容器连接到RDS Mysql_Mysql_Wordpress_Amazon Web Services_Docker_Rds - Fatal编程技术网

使用Wordpress从docker容器连接到RDS Mysql

使用Wordpress从docker容器连接到RDS Mysql,mysql,wordpress,amazon-web-services,docker,rds,Mysql,Wordpress,Amazon Web Services,Docker,Rds,使用docker compose启动wordpress容器,但在该容器中,我希望连接到AWS上的RDS mysql实例。我可以设置wordpress,但无法连接到数据库。我已尝试将DB_NAME变量更改为_数据库。我还可以使用mac上的mysql命令行来建立连接 version: '2' services: wordpress: image: wordpress:latest ports: - "8000:80" restart: always

使用docker compose启动wordpress容器,但在该容器中,我希望连接到AWS上的RDS mysql实例。我可以设置wordpress,但无法连接到数据库。我已尝试将DB_NAME变量更改为_数据库。我还可以使用mac上的mysql命令行来建立连接

version: '2'

services:
   wordpress:
     image: wordpress:latest
     ports:
       - "8000:80"
     restart: always
     environment:
       MYSQL_HOST: "endpoint"
       MYSQL_USER: "user"
       MYSQL_PASSWORD: "pass"
       MYSQL_DB_NAME: "wordpress_docker"
       MYSQL_PORT: 3306
     volumes:
       - ${HOME}:/var/lib/mysql
根据WordPress的

环境名称应为

WORDPRESS_DB_HOST=... (defaults to the IP and port of the linked mysql container)
WORDPRESS_DB_USER=... (defaults to "root")
WORDPRESS_DB_PASSWORD=... (defaults to the value of the MYSQL_ROOT_PASSWORD environment variable from the linked mysql container)
WORDPRESS_DB_NAME=... (defaults to "wordpress")
WORDPRESS_TABLE_PREFIX=... (defaults to "", only set this when you need to override the default table prefix in wp-config.php)

你们提供什么主机?RDS实例地址?对于主机,我使用长端点
.us-west-1.RDS.amazonaws.com
嘿,它在@Patrick工作吗?在db_主机中指定endpoint:port对我不起作用。我没有mysql容器。它直接连接到rds。@Satys如果指定endpoint:port-WORDPRESS\u-DB\u-HOST不适合您,在您的情况下,我可以说尝试直接从机器连接到rds。连接是RDS的常见问题。也许,安全小组是不对的。或者db用户无法远程访问。您好,我面临类似的挑战:。你能分享一下你的文件吗?另外,您如何为SSL指定CA证书?PS:我可以通过MySQL workbench从本地桌面连接到远程RDS实例。