当前位置:网站首页>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>
边栏推荐
- kubernetes集群之Label管理
- Campus network problems
- Cervical vertebra, beriberi
- What is the use of cloud redis? How to use cloud redis?
- Recursive Fusion and Deformable Spatiotemporal Attention for Video Compression Artifact Reduction
- js 常用时间处理函数
- MySQL 45 lecture learning notes (XIII) delete half of the table data, and the table file size remains the same
- MySQL 45 lecture learning notes (VII) line lock
- [FPGA tutorial case 7] design and implementation of counter based on Verilog
- The number of patent applications in China has again surpassed that of the United States and Japan, ranking first in the world for 11 consecutive years
猜你喜欢
NLP-文献阅读总结
BasicVSR++: Improving Video Super-Resolutionwith Enhanced Propagation and Alignment
Summary of MySQL common judgment functions!! Have you used it
Flink memory model, network buffer, memory tuning, troubleshooting
What is the use of cloud redis? How to use cloud redis?
Introduction to spark core components
Adaptive spatiotemporal fusion of multi-target networks for compressed video perception enhancement
The most effective futures trend strategy: futures reverse merchandising
Zabbix agent主动模式的实现
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
随机推荐
NLP literature reading summary
[untitled] notice on holding "2022 traditional fermented food and modern brewing technology"
MySQL 45 lecture learning notes (XIII) delete half of the table data, and the table file size remains the same
MySQL 45 lecture learning notes (12) MySQL will "shake" for a while
响应式移动Web测试题
[GF (q) + LDPC] regular LDPC coding and decoding design and MATLAB simulation based on the GF (q) field of binary graph
高薪程序员&面试题精讲系列119之Redis如何实现分布式锁?
Paddleocr prompt error: can not import AVX core while this file exists: xxx\paddle\fluid\core_ avx
Chain ide -- the infrastructure of the metauniverse
Cervical vertebra, beriberi
Check and display one column in the known table column
Vulhub vulnerability recurrence 76_ XXL-JOB
[FPGA tutorial case 8] design and implementation of frequency divider based on Verilog
Valentine's Day is coming! Without 50W bride price, my girlfriend was forcibly dragged away...
2022 - 021arts: début du deuxième semestre
请问旧版的的常用SQL怎么迁移到新版本里来?
[Flink] temporal semantics and watermark
Selenium ide plug-in download, installation and use tutorial
Solution of running crash caused by node error
《剑指Offer》第2版——力扣刷题