当前位置:网站首页>Docker installation and mysql5 7 installation
Docker installation and mysql5 7 installation
2022-04-23 04:59:00 【GreatorMan】
Every program has its own virtual machine , When we install some software , We use it DOCKER It is convenient to install some software ;
First of all, in accordance with the DOCKER
Environmental Science
System :centos 8
CPU:2
Memory :4G
According to the official website, follow the script :
curl -sSL https://get.daocloud.io/docker | sh
Input at the console :
docker version
Output
[root@VM-16-10-centos home]# docker version
Client: Docker Engine - Community
Version: 20.10.10
API version: 1.41
Go version: go1.16.9
Git commit: b485636
Built: Mon Oct 25 07:42:56 2021
OS/Arch: linux/amd64
Context: default
Experimental: true
Server: Docker Engine - Community
Engine:
Version: 20.10.10
API version: 1.41 (minimum version 1.12)
Go version: go1.16.9
Git commit: e2f740d
Built: Mon Oct 25 07:41:17 2021
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.4.11
GitCommit: 5b46e404f6b9f661a205e28d59c982d3634148f8
runc:
Version: 1.0.2
GitCommit: v1.0.2-0-g52b36a2
docker-init:
Version: 0.19.0
GitCommit: de40ad0
Then install MYSQL 5.7
pull Mirror to local
docker pull mysql:5.7
After execution mysql The mirrored version is pulled locally ; grammar : docker pull name : edition
adopt docker images Look at the mirror image
[root@VM-16-10-centos home]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
mysql 5.7 938b57d64674 3 weeks ago 448MB
mysql latest ecac195d15af 3 weeks ago 516MB
Run start , as follows :
docker run -d -p 3306:3306 --name mysql \
-v /home/mysql/mysql/conf:/etc/mysql \
-v /home/mysql/mysql/logs:/var/log/mysql \
-v /home/mysql/mysql/data:/var/lib/mysql \
-e MYSQL_ROOT_PASSWORD=12324 \
mysql:5.7 \
--lower_case_table_names=1 \
--max-allowed-packet=1073741824 \
--character_set_server=utf8 \
--innodb_log_file_size=256m
- –name: Container name , It's called
mysql
- -e: Configuration information , Configure here mysql Of root User's login password
- -p: Port mapping , Map here host 3306 port To Container of 3306 port
- -d: Background running container , Ensure that the container continues to run after exiting the terminal
- -v: Data volume mount
If your server is in China , The following error occurs
docker: Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: re
Timeout while waiting for header , The request was cancelled while waiting for the connection ( client ).Docker The default source is foreign official source , Slow download , It can be changed to domestic image source .
[root@localhost ~]# cd /etc/docker
[root@localhost docker]# ls
daemon.json key.json
[root@localhost docker]# vim daemon.json
{
"registry-mirrors": ["http://hub-mirror.c.163.com"]
}
# Then restart
[root@localhost docker]# systemctl daemon-reload
[root@km docker]# systemctl restart docker
Running MYSQL
docker run -d -p 3306:3306 --name mysql \
-v /home/mysql/mysql/conf:/etc/mysql \
-v /home/mysql/mysql/logs:/var/log/mysql \
-v /home/mysql/mysql/data:/var/lib/mysql \
-e MYSQL_ROOT_PASSWORD=12324 \
mysql:5.7 \
--lower_case_table_names=1 \
--max-allowed-packet=1073741824 \
--character_set_server=utf8 \
--innodb_log_file_size=256m
function docker ps |grep mysql
[root@VM-16-10-centos home]# docker ps|grep mysql
17d95f1a7f4d mysql:5.7 "docker-entrypoint.s…" 30 minutes ago Up 30 minutes 0.0.0.0:3306->3306/tcp, :::3306->3306/tcp, 33060/tcp mysql
Installation successful
版权声明
本文为[GreatorMan]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204220553101928.html
边栏推荐
- The 8 diagrams let you see the execution sequence of async / await and promise step by step
- SCP command details
- js 判断数字字符串中是否含有字符
- Pixel 5 5g unlocking tutorial (including unlocking BL, installing edxposed and root)
- Innovation training (VI) routing
- Pixel mobile phone brick rescue tutorial
- CLion+OpenCV identify ID number - detect ID number
- Com alibaba. Common methods of fastjson
- L2-011 玩转二叉树(建树+BFS)
- L2-011 play binary tree (build tree + BFS)
猜你喜欢
Deep learning notes - fine tuning
【数据库】表的查看、修改和删除
Learning Android from scratch -- Introduction
Basic concepts of multithreading (concurrency and parallelism, threads and processes) and entry cases
Detailed explanation of the differences between TCP and UDP
Excel protects worksheets and workbooks from damage
[WinUI3]编写一个仿Explorer文件管理器
Making message board with PHP + MySQL
DIY is an excel version of subnet calculator
Sword finger offer: the path with a certain value in the binary tree (backtracking)
随机推荐
独立站运营 | FaceBook营销神器——聊天机器人ManyChat
【数据库】MySQL多表查询(一)
List remove an element
Excel uses the functions of replacement, sorting and filling to comprehensively sort out financial data
持续集成(CI)/持续交付(CD)如何彻底改变自动化测试
Thoughts on a small program
HRegionServer的详解
Mac 进入mysql终端命令
The difference between static pipeline and dynamic pipeline
[2021] Spatio-Temporal Graph Contrastive Learning
Unity camera rotation with sliding effect (rotation)
JS generates a specified number of characters according to some words
ApplicationContext injection bean
Arduino UNO r3+LCD1602+DHT11
深度学习笔记 —— 数据增广
Painless upgrade of pixel series
Innovation training (VI) routing
vscode ipynb文件没有代码高亮和代码补全解决方法
Pixel mobile phone brick rescue tutorial
Raspberry pie + opencv + opencv -- face detection ------- environment construction