当前位置:网站首页>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
边栏推荐
- Details related to fingerprint payment
- 直播带货表格模板-自动显示图片-自动关联系列商品
- Use AES encryption - reuse the wisdom of predecessors
- [database] MySQL multi table query (I)
- Sword finger offer: the path with a certain value in the binary tree (backtracking)
- Innovation training (II) task division
- Mac enters MySQL terminal command
- [2022 ICLR] Pyraformer: Low-Complexity Pyramidal Attention for Long-Range 时空序列建模和预测
- JS détermine si la chaîne de nombres contient des caractères
- Innovation training (VI) routing
猜你喜欢
Download PDF from HowNet (I don't want to use CAJViewer anymore!!!)
CLion+OpenCV identify ID number - detect ID number
Field injection is not recommended using @ Autowired
Pixel 5 5g unlocking tutorial (including unlocking BL, installing edxposed and root)
View, modify and delete [database] table
深度学习笔记 —— 微调
Innovation training (V) configuration information
Excel protects worksheets and workbooks from damage
AQS源码阅读
Learning Android II from scratch - activity
随机推荐
Use model load_ state_ Attributeerror appears when dict(): 'STR' object has no attribute 'copy‘
redis和mysql区别
Basic concepts of multithreading (concurrency and parallelism, threads and processes) and entry cases
ApplicationContext injection bean
Set Chrome browser background to eye protection (eye escort / darkreader plug-in)
[2021] Spatio-Temporal Graph Contrastive Learning
MySQL - index
C. Tree Infection(模拟+贪心)
Analysis of POM files
Use AES encryption - reuse the wisdom of predecessors
Use the built-in function of win to transfer files between two computers in the same LAN (the speed is the same as that between local disks)
What are instruction cycles, machine cycles, and clock cycles?
多线程基本概念(并发与并行、线程与进程)和入门案例
Painless upgrade of pixel series
JS generates a specified number of characters according to some words
Com alibaba. Common methods of fastjson
What is a blocking queue? What is the implementation principle of blocking queue? How to use blocking queue to implement producer consumer model?
The unity camera rotates with the mouse
独立站运营 | FaceBook营销神器——聊天机器人ManyChat
Learning Android from scratch -- Introduction