mysql 连接出错。
来源:6-3 Docker Compose的安装和基本使用
阿姆斯特朗回旋炮
2018-07-05
wordpress_1 |
wordpress_1 | MySQL Connection Error: (2002) No route to host
wordpress_1 |
wordpress_1 | Warning: mysqli::__construct(): (HY000/2002): No route to host in Standard input code on line 22
wordpress_1 |
wordpress_1 | MySQL Connection Error: (2002) php_network_getaddresses: getaddrinfo failed: Name or service not known
wordpress_1 |
wordpress_1 | Warning: mysqli::__construct(): php_network_getaddresses: getaddrinfo failed: Name or service not known in Standard input code on line 22
写回答
1回答
-
阿姆斯特朗回旋炮
提问者
2018-07-05
这是我的yaml file: version: '3' services: wordpress: image: wordpress ports: - 8080:80 depends_on: - mysql links: - mysql environment: WORDPRESS_DB_HOST: mysql:3306 WORDPRESS_DB_PASSWORD: root networks: - my-bridge mysql: image: mysql:5.7 environment: MYSQL_ROOT_PASSWORD: root MYSQL_DATABASE: wordpress volumes: - mysql-data:/var/lib/mysql networks: - my-bridge volumes: mysql-data: networks: my-bridge: driver: bridge
032018-07-05
相似问题