이글은 2019/03/29 - [OS/우분투] - 우분투 18.04 Docker 설치 에서 넘온것입니다.
추가출처 : https://psychoria.tistory.com/490?category=598136
마리아디비 이미지 검색)
dev@dev-desktop:~$ sudo docker search mariadb NAME DESCRIPTION STARS OFFICIAL AUTOMATED mariadb MariaDB is a community-developed fork of MyS… 2664 [OK] bitnami/mariadb Bitnami MariaDB Docker Image 91 [OK] linuxserver/mariadb A Mariadb container, brought to you by Linux… 61 toughiq/mariadb-cluster Dockerized Automated MariaDB Galera Cluster … 37 [OK] yobasystems/alpine-mariadb MariaDB running on Alpine Linux [docker] [am… 35 [OK] colinmollenhour/mariadb-galera-swarm MariaDb w/ Galera Cluster, DNS-based service… 25 [OK] jsurf/rpi-mariadb mariadb for rpi based on jsurf/rpi-raspbian 22 [OK] panubo/mariadb-galera MariaDB Galera Cluster 21 [OK] lsioarmhf/mariadb ARMHF based Linuxserver.io image of mariadb 17 webhippie/mariadb Docker images for MariaDB 14 [OK] monitoringartist/zabbix-db-mariadb Docker image of MariaDB optimized for Zabbix 11 [OK] 1and1internet/ubuntu-16-nginx-php-phpmyadmin-mariadb-10 ubuntu-16-nginx-php-phpmyadmin-mariadb-10 11 [OK] severalnines/mariadb A homogeneous MariaDB Galera Cluster image t… 6 [OK] centos/mariadb-101-centos7 MariaDB 10.1 SQL database server 6 juanluisbaptiste/otrs-mariadb Preconfigured MariaDB database for OTRS 6 [OK] centos/mariadb-102-centos7 MariaDB 10.2 SQL database server 5 tutum/mariadb Base docker image to run a MariaDB database … 4 wodby/mariadb Alpine-based MariaDB container image with or… 4 [OK] circleci/mariadb CircleCI images for MariaDB 3 [OK] rightctrl/mariadb Mariadb with Galera support 2 [OK] jonbaldie/mariadb Fast, simple, and lightweight MariaDB Docker… 2 [OK] kitpages/mariadb-galera MariaDB with Galera 2 [OK] ausov/k8s-mariadb-cluster Example MariaDB Galera image for Kubernetes … 1 [OK] ansibleplaybookbundle/mariadb-apb An APB which deploys RHSCL MariaDB 0 [OK] jelastic/mariadb
공식 릴리증중에 최신버전 당겨오기)
dev@dev-desktop:~$ sudo docker pull mariadb:latest [sudo] dev의 암호: latest: Pulling from library/mariadb 898c46f3b1a1: Pull complete 63366dfa0a50: Pull complete 041d4cd74a92: Pull complete 6e1bee0f8701: Pull complete 0fa9bfc0c84b: Pull complete 8e9b088fe106: Pull complete af96bccda5c4: Pull complete 0655ee57b408: Pull complete 58e50a9049b1: Pull complete 57cd7839e491: Pull complete 067ff7ef6a22: Pull complete 895af18c21d0: Pull complete 1ab4788d5ff4: Pull complete a068a53bcb17: Pull complete Digest: sha256:06dd6d6234977e9231567cc00b9a994f467417e0419efd61f356a0018064d3a0 Status: Downloaded newer image for mariadb:latest
현재 도커이미지 확인)
mariadb가 있음을 확인이 가능합니다.
dev@dev-desktop:~$ sudo docker images REPOSITORY TAG IMAGE ID CREATED SIZE mariadb latest e93652b8b80d 2 weeks ago 368MB hello-world latest fce289e99eb9 2 months ago 1.84kB
DB컨테이너 생성)
dev@dev-desktop:~$ sudo docker run --name 이름 -e MYSQL_ROOT_PASSWORD=비밀번호 -d mariadb:latest
dev@dev-desktop:~$ sudo docker run -d -p 3306:3306 --name mariadb2 -e MYSQL_ROOT_PASSWORD=**** -d mariadb:latest a8ce37b06980a787e4f332499238cd0abc2b********************dac5fc6c
생성된 도커 확인)
dev@dev-desktop:~$ sudo docker ps -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES a8ce37b06980 mariadb:latest "docker-entrypoint.s…" 13 minutes ago Up 13 minutes 0.0.0.0:3306->3306/tcp mariadb2 50b4cc6204cb hello-world "/hello" 4 hours ago Exited (0) 4 hours ago ecstatic_poitras
동작중인 도커 확인)
dev@dev-desktop:~$ sudo docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES a8ce37b06980 mariadb:latest "docker-entrypoint.s…" 12 minutes ago Up 12 minutes 0.0.0.0:3306->3306/tcp mariadb2
마리아디비 접속)
dev@dev-desktop:~$ sudo docker exec -it mariadb2 bash root@a8ce37b06980:/# mysql -u root -p Enter password: Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 19 Server version: 10.3.13-MariaDB-1:10.3.13+maria~bionic mariadb.org binary distribution Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]>
GUI 툴로 마리아디비 컨테이너 접속하기)
- GUI툴 Workbench툴을 이용하겠습니다.
- 사이트 주소 : https://dev.mysql.com/downloads/workbench/
전 이미 있지만 Database -> Connect to Database
hostname, port, username 까지 기본값으로 설정되었습니다.
자신에 맞게 설정하시면됩니다.
단 port는 컨테이너 생성시 3306:3306중에 앞에있는 3306 포트를 지정하시면됩니다.
정상적으로 연결되면 아래와같이 뜹니다.
추가로 보면 좋을 자료 : https://gmlwjd9405.github.io/2018/05/09/mysql-workbench-guide.html
반응형
'OS > 우분투' 카테고리의 다른 글
무료 SSL (기간제한 3달짜리) 발급부터 nginx 적용까지 한번에 하자 (0) | 2020.04.25 |
---|---|
우분투 18.04 Docker 설치 (0) | 2019.03.29 |
우분투 18.04 MAVEN 설치 (0) | 2019.03.29 |
우분투 18.04 Openjdk 1.8 설치 (0) | 2019.03.29 |
설치시 유용한 사이트 모음 (0) | 2019.03.29 |