05-15 08:39
Recent Posts
Recent Comments
๊ด€๋ฆฌ ๋ฉ”๋‰ด

miinsun

[Docker] MySQL์„ค์น˜ ๋ณธ๋ฌธ

Infra/Docker

[Docker] MySQL์„ค์น˜

miinsun 2021. 12. 2. 16:11

๐Ÿ’ป ์‹ค์Šต ํ™˜๊ฒฝ

OS : CentOS 8
Architecture : x89-64

 

๐Ÿ“Œ mysql image ๋‹ค์šด

$ docker pull mysql:8

 

๐Ÿ“Œ mysql image ์‹คํ–‰

$ docker run --name mysql8 -e MYSQL_ROOT_PASSWORD=๊ด€๋ฆฌ์ž๋น„๋ฐ€๋ฒˆํ˜ธ -p 3306:3306 -d mysql:8

 

๐Ÿ“Œ docker ์ƒํƒœ ํ™•์ธ

$ docekr ps

 

๐Ÿ“Œ mySql ์‹คํ–‰

$ docker exec -i -t mysql:8 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.27 MySQL Community Server - GPL

Copyright (c) 2000, 2021, 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> ctrl + p + q <!-- mysql docker ์ข…๋ฃŒ -->
โ€‹
Comments