Docker MySQL Setting
•
root 비밀번호: root
➜ kuke-board git:(main) ✗ docker pull mysql:8.0.38
8.0.38: Pulling from library/mysql
c72f53f7235b: Pull complete
c7e4ed755af2: Pull complete
6c8c802f90bc: Pull complete
eecc55f854cd: Pull complete
cc8dabc09813: Pull complete
a29e21a87dbd: Pull complete
78c58fcb53d9: Pull complete
b9ed9981deb0: Pull complete
665f4cb1ffd7: Pull complete
912d9ddb9406: Pull complete
bfda302a1deb: Pull complete
Digest: sha256:5c78edf3b6f4ac8aa30df543bba8a4db2ac009f91271b207d4cbeed98b9d9984
Status: Downloaded newer image for mysql:8.0.38
docker.io/library/mysql:8.0.38
What's next:
View a summary of ima
➜ kuke-board git:(main) ✗ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
mysql latest 7ce93a845a8a 7 months ago 586MB
mysql 8.0.38 eefa4e35197d 7 months ago 590MB
mysql 8.2.0 a76e521c0292 14 months ago 639MB
mysql 8.0.30 1699df6c42a3 2 years ago 494MB
➜ kuke-board git:(main) ✗ docker run --name kuke-board-mysql -e MYSQL_ROOT_PASSWORD=root -d -p 3308:3306 mysql:8.0.38
9ca8eee6876cd009c7f077abc0a9e8d9376e0a539911cc71a4e21b048e6cb8a9
➜ kuke-board git:(main) ✗ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
9ca8eee6876c mysql:8.0.38 "docker-entrypoint.s…" 7 seconds ago Up 6 seconds 33060/tcp, 0.0.0.0:3308->3306/tcp kuke-board-mysql
➜ kuke-board git:(main) ✗
➜ kuke-board git:(main) ✗ docker exec -it kuke-board-mysql bash
bash-5.1# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 8
Server version: 8.0.38 MySQL Community Server - GPL
Copyright (c) 2000, 2024, 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>
➜ kuke-board git:(main) ✗ docker start kuke-board-mysql
kuke-board-mysql
➜ kuke-board git:(main) ✗ docker stop kuke-board-mysql
kuke-board-mysql
Java
복사