当前位置:网站首页>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>
边栏推荐
- tornado项目之路由装饰器
- jdbc连接es查询的时候,有遇到下面这种情况的大神嘛?
- 在已經知道錶格列勾選一個顯示一列
- MySQL 45 lecture learning notes (12) MySQL will "shake" for a while
- How to buy financial products in 2022?
- 移动适配:vw/vh
- The important role of host reinforcement concept in medical industry
- Chain ide -- the infrastructure of the metauniverse
- Introduction to deep learning Ann neural network parameter optimization problem (SGD, momentum, adagrad, rmsprop, Adam)
- Rhcsa day 3
猜你喜欢
Data double write consistency between redis and MySQL
Solution of running crash caused by node error
Four sets of APIs for queues
A real penetration test
Review of enterprise security incidents: how can enterprises do a good job in preventing source code leakage?
What is the use of cloud redis? How to use cloud redis?
Cervical vertebra, beriberi
Campus network problems
leetcode825. Age appropriate friends
Boosting the Performance of Video Compression Artifact Reduction with Reference Frame Proposals and
随机推荐
Node connection MySQL access denied for user 'root' @ 'localhost' (using password: yes
Selection (022) - what is the output of the following code?
提升复杂场景三维重建精度 | 基于PaddleSeg分割无人机遥感影像
Literature collation and thesis reading methods
How to buy financial products in 2022?
How can the old version of commonly used SQL be migrated to the new version?
高薪程序员&面试题精讲系列119之Redis如何实现分布式锁?
Latex中的单引号,双引号如何输入?
Why does the producer / consumer mode wait () use while instead of if (clear and understandable)
Technical experts from large factories: common thinking models in architecture design
Electronic Association C language level 1 34, piecewise function
电子协会 C语言 1级 34 、分段函数
2022年6月小结
果果带你写链表,小学生看了都说好
MySQL 45 lecture learning notes (12) MySQL will "shake" for a while
uniapp小程序分包
两年前美国芯片扭捏着不卖芯片,如今芯片堆积如山祈求中国帮忙
window上用.bat文件启动项目
Centos8 install mysql 7 unable to start up
[MySQL transaction]