DOCKER로 MYSQL 서버 접속하기

NOAH·2021년 1월 28일
0
post-thumbnail

install mysql through Docker

$ docker pull mysql

pull mysql images

$ docker run --name noahmysql -e MYSQL_ROOT_PASSWORD=noahpassword -d mysql:tag

noahmysql = name you wnat to assign to your conctainer

noahpassword = the password to be set for the MySQL root user

tag = mysql version you want

Exec container

$ docker exec -it noahmysql bash

bash = connect mysql on docker and mac-terminal

$ myql -uroot -p

enter password you set

$ show database;

will show databases in mysql

$ quit

MYSQL will be terminated

$ /# exit

getting back to yout own terminal

Reference

0개의 댓글