Docker Container Mysql 접속하기

2023. 1. 15. 12:39·미분류글

docker로 띄운 mysql에 접속하여 존재하는 database들을 확인해보고자 했다.

(docker container는 존재하는 상태임)

 

 

컨테이너 시작

docker start containerName

 

컨테이너 접속

docker exec -it containerName bash

참고 : -it는 Interactive Terminal Mode를 뜻한다.

 

 

 

★ mysql 관리자로 접속

mysql -u root -p

 

그럼 아래와 같이 mysql Password 입력 후에 접속이 완료된다.

 

Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 19
Server version: 8.0.31 MySQL Community Server - GPL

Copyright (c) 2000, 2022, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql>

 

 

 

완료!

★ 이제 mysql CLI로 사용하면 된다.

 

databases 확인해보며 마친다.

mysql> show databases;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| order_mgmt         |
| performance_schema |
| sys                |
+--------------------+
5 rows in set (0.01 sec)

 

 

 

반응형

'미분류글' 카테고리의 다른 글

Intellij 터미널에서 명령어가 안 먹히는 이유  (0) 2023.02.03
미팅1: 계획서 발표 + 파이프라인 조언  (5) 2023.02.02
Join 테이블 전략 (상속관계매핑) 상태에서 부모테이블 truncate하기  (0) 2023.01.27
docker 기본 사용법 - 명령어  (0) 2023.01.10
빌드 실패 해결 - Gradle JVM의 sdk 설정 필요 | A problem occurred configuring root project 'demo'. | Could not resolve all files for configuration ':classpath'. | Could not resolve org.springframework.boot:spring-boot-gradle-plugin:3.0.1.  (0) 2023.01.03
'미분류글' 카테고리의 다른 글
  • 미팅1: 계획서 발표 + 파이프라인 조언
  • Join 테이블 전략 (상속관계매핑) 상태에서 부모테이블 truncate하기
  • docker 기본 사용법 - 명령어
  • 빌드 실패 해결 - Gradle JVM의 sdk 설정 필요 | A problem occurred configuring root project 'demo'. | Could not resolve all files for configuration ':classpath'. | Could not resolve org.springframework.boot:spring-boot-gradle-plugin:3.0.1.
히어로맛쿠키
히어로맛쿠키
  • 히어로맛쿠키
    yeny_lab
    히어로맛쿠키
  • 전체
    오늘
    어제
    • 분류 전체보기 (389)
      • 미분류글 (32)
        • ㅇ (2)
      • JAVA (84)
        • Effective Java (1)
        • Application (21)
      • 컴퓨터구조 & OS (28)
      • 자료구조 + 알고리즘 (43)
      • Database (12)
      • 컴파일러 (10)
      • 수학 (33)
        • 미분방정식 (12)
      • 데이터분석과 머신러닝 (38)
      • 기타 (59)
      • yyeeennyy (25)
  • 공지사항

    • ^o^/♡
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.0
히어로맛쿠키
Docker Container Mysql 접속하기
상단으로

티스토리툴바