Docker compose mysql reachable on port 3306

Fabian Lurz

How can i make the mysql database in this docker-compose reachable from "outside" - meaning that i can connect with a database administration tool for example on port 3306:

wordpress:
 build: /Users/FabianL/wp-docker/
 container_name: "kr-wp-container"
 links:
   - db:mysql
 ports:
   - 8080:80
   - 3306:3306
db:
 image: mysql
 environment:
   MYSQL_ROOT_PASSWORD: biersaufen
VDR

You have opened port 8080 and 3306 from container "wordpress" and none from container "db"

Change your compose file to:

wordpress:
 build: /Users/FabianL/wp-docker/
 container_name: "kr-wp-container"
 links:
   - db:mysql
 ports:
   - 8080:80
db:
 image: mysql
 environment:
   MYSQL_ROOT_PASSWORD: biersaufen
 ports:
   - 3306:3306

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How to connect to MySQL created with docker to another port (not port 3306)?

Docker Compose getting error ECONNREFUSED 127.0.0.1:3306 with MySQL and NodeJS

Run MySQL on Port 3307 Using Docker Compose

MySQL binds to port 3307 not port 3306

Docker Swarm container reachable although port is not open?

Port not exposed but still reachable on internal docker network

Docker Compose connect ECONNREFUSED 172.18.0.4:3306

Can't connect to MySQL server on 'localhost:3306' in dockerised Django app using docker-compose

Can't find MySql port 3306

MySQL Port 3306 on VPS not visible from remote

XAMPP MySQL port 3306 keeps reseting itself

MySQL port 3306 vs 3307 Differences

How to resolve mysql port 3306 error on wamp?

port 3306 not available in mysql server configuration

MySQL Not Binding to Correct Port When Running docker-compose in CloudBuild

Prevent public access to MySQL port running using Docker-compose

Docker killing 3306 usage port cause of crashing docker

what is the port 33060 for mysql server ports in addition to the port 3306

docker-compose external_link mongo network not reachable

Spring Config server not reachable with docker-compose until client is restarted

Go REST API not reachable using docker-compose

Can not connect docker mysql that's forwarding to 3306

Docker Compose + Postgres: Expose port

Docker compose access to port on host

Change container port in docker compose

Airflow change port in docker compose

Can't Connect to the remote MYSQL server via 3306 port

How do you configure MySQL to run on localhost port 3306?

How to change the default port of mysql from 3306 to 3360