mysql 포트를 표시하는 방법
3310
원격에서 MySQL
」. 은 다음과 같습니다.지금까지의 설정은 다음과 같습니다.
database:
container_name: sfapi_db
restart: always
ports:
- 3310:3306
build:
context: ./docker/database
environment:
- MYSQL_DATABASE=${DB_NAME}
- MYSQL_USER=${DB_USER}
- MYSQL_PASSWORD=${DB_PWD}
- MYSQL_ROOT_PASSWORD=${DB_PWD_ROOT}
volumes:
- dbdata:/var/lib/mysql
- type: bind
source: ./docker/database/my.cnf
target: /etc/mysql/my.cnf
도커 파일입니다.
FROM mariadb:latest
CMD ["mysqld"]
EXPOSE 3310
my.cnf:
[client-server]
# Port or socket location where to connect
port = 3310
socket = /run/mysqld/mysqld.sock
# Import all .cnf files from configuration directory
!includedir /etc/mysql/conf.d/
!includedir /etc/mysql/mariadb.conf.d/
가 뛰었을 때docker-compose up --build -d
컨테이너 리스트에 액세스 할 수 있습니다.
, 포토도, 포토를 「포토」를 사용해 했습니다.sudo ufw allow 3310
또한 포트 3306은 다른 컨테이너에서 사용하기 때문에 사용할 수 없습니다.3310년
어떤 이유에서인지 그곳에 가서 포트 3310이 열려 있는지 확인하면 항상 닫혀 있습니다.
어떻게 하면 고칠 수 있을까요?
경우,my.cnf
을 사용하다는 음음음 then then then then then then then then then then then then then로 해야 .3306
[client-server]
# Port or socket location where to connect
port = 3306
socket = /run/mysqld/mysqld.sock
컨테이너의 컨텍스트에서는 이것이 mysql을 표시하는 포트이기 때문입니다.
아마 요?그러면 당신이 죠?3306
는 ""를 했습니다"3310
servermysql의 .3306번
언급URL : https://stackoverflow.com/questions/71099929/how-to-expose-mysql-port
'programing' 카테고리의 다른 글
프로그래밍 기술을 향상시키기 위한 매우 작은 프로그램? (0) | 2022.10.29 |
---|---|
Runtime을 슬로우하는 메서드메서드 서명에 예외가 표시됩니까? (0) | 2022.10.29 |
번들러에는 .min 파일이 포함되지 않습니다. (0) | 2022.10.29 |
MariaDB / MySQL 2개의 테이블 결합 (0) | 2022.10.29 |
왜 Java 어레이인가?정렬 방법은 두 가지 다른 유형의 정렬 알고리즘을 사용합니까? (0) | 2022.10.29 |