위 명령어를 실행하면 두 가지 환경변수가 mysql 에 셋팅된다.( root계정으로 로그인 시 비밀번호를 입력을 생략하고 daeun-db 라는 이름의 데이터베이스를 생성한다.) 컨테이너에 들어가서 확인해보자.
➜ ~ docker exec -it f43167e21be6 bash
root@f43167e21be6:/# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.17 MySQL Community Server - GPL
Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
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> show databases;
+--------------------+
| Database |
+--------------------+
| daeun-db |
| information_schema |
| mysql |
| performance_schema |
| sys |
+--------------------+
5 rows in set (0.01 sec)
mysql>