当前位置:网站首页>Docker install MySQL
Docker install MySQL
2022-07-04 07:15:00 【MambaCloud】
docker install mysql
1、 First, install it docker
2、 Pull the latest mysql Mirror version
[[email protected] ~]# docker pull mysql:latest
latest: Pulling from library/mysql
72a69066d2fe: Pull complete
93619dbc5b36: Pull complete
99da31dd6142: Pull complete
626033c43d70: Pull complete
37d5d7efb64e: Pull complete
ac563158d721: Pull complete
d2ba16033dad: Pull complete
688ba7d5c01a: Pull complete
00e060b6d11d: Pull complete
1c04857f594f: Pull complete
4d7cfa90e6ea: Pull complete
e0431212d27d: Pull complete
Digest: sha256:e9027fe4d91c0153429607251656806cc784e914937271037f7738bd5b8e7709
Status: Downloaded newer image for mysql:latest
3、 View local image
[[email protected] ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
mysql latest 3218b38490ce 7 weeks ago 516MB
4、 Run container
[[email protected] ~]# docker run -itd --name mysql-test -p 3306:3306 -e MYSQL_ROOT_PASSWORD=123456 mysql
b827facfe1926df7842f7a407d57e0458f26122a1576ba27203a676540f2c126
5、 View currently running containers
[[email protected] ~]# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
b827facfe192 mysql "docker-entrypoint.s…" 42 seconds ago Up 40 seconds 0.0.0.0:3306->3306/tcp, 33060/tcp mysql-test
6、 Enter the container and connect to it normally mysql
[[email protected] ~]# docker exec -it mysql-test bash
[email protected]:/# mysql
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
[email protected]:/# mysql -h localhost -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 9
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>
边栏推荐
- Solution of running crash caused by node error
- Boast about Devops
- notepad++如何统计单词数量
- 2022-021rts: from the second half of the year
- leetcode825. Age appropriate friends
- Tar source code analysis Part 10
- Four sets of APIs for queues
- 《剑指Offer》第2版——力扣刷题
- Redis interview question set
- [web security] nodejs prototype chain pollution analysis
猜你喜欢
What is the use of cloud redis? How to use cloud redis?
Flink memory model, network buffer, memory tuning, troubleshooting
The important role of host reinforcement concept in medical industry
win10微软拼音输入法输入文字时候下方不出现中文提示
Review of enterprise security incidents: how can enterprises do a good job in preventing source code leakage?
响应式移动Web测试题
Uniapp applet subcontracting
Four sets of APIs for queues
tornado项目之路由装饰器
Introduction to deep learning Ann neural network parameter optimization problem (SGD, momentum, adagrad, rmsprop, Adam)
随机推荐
Bottom problem of figure
【FreeRTOS】FreeRTOS學習筆記(7)— 手寫FreeRTOS雙向鏈錶/源碼分析
2022-021ARTS:下半年開始
两年前美国芯片扭捏着不卖芯片,如今芯片堆积如山祈求中国帮忙
About how idea sets up shortcut key sets
Why does the producer / consumer mode wait () use while instead of if (clear and understandable)
[network data transmission] FPGA based development of 100M / Gigabit UDP packet sending and receiving system, PC to FPGA
Boosting the Performance of Video Compression Artifact Reduction with Reference Frame Proposals and
BasicVSR++: Improving Video Super-Resolutionwith Enhanced Propagation and Alignment
Review of enterprise security incidents: how can enterprises do a good job in preventing source code leakage?
The crackdown on Huawei prompted made in China to join forces to fight back, and another enterprise announced to invest 100 billion in R & D
How can the old version of commonly used SQL be migrated to the new version?
How notepad++ counts words
[freertos] freertos Learning notes (7) - written freertos bidirectionnel Link LIST / source analysis
[FPGA tutorial case 8] design and implementation of frequency divider based on Verilog
测试用例的设计
NLP-文献阅读总结
How to share the source code anti disclosure scheme
Cervical vertebra, beriberi
CMS source code of multi wechat management system developed based on thinkphp6, with one click curd and other functions