我正在尝试用docker容器用wordpress构建一个新的应用程序,但是我没能用mysql容器连接它。
我使用这个命令来构建mysql容器。 docker run --name wordpress-mysql -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=wordpress -d mysql:latest
运行wordpress容器。 docker run --name wordpress-blog --link wordpress-mysql:mysql -p 8083:80 -e WORDPRESS_DB_HOST=wordpress-mysql:3366 -e WORDPRESS_DB_USER=root -e WORDPRESS_DB_PASSWORD=root -e WORDPRESS_DB_NAME=wordpress -e WORDPRESS_TABLE_PREFIX=wp_ -d wordpress
现在wordpress容器没有运行并返回此错误。 Warning: mysqli::__construct(): (HY000/2002): Connection refused in Standard input code on line 22 2018-07-02T07:49:49.727093500Z MySQL Connection Error: (2002) Connection refused
暂无答案!
目前还没有任何答案,快来回答吧!