当前位置:网站首页>Docker installing MySQL
Docker installing MySQL
2022-06-30 21:52:00 【Tata Tata y】
Do not specify version number , Download the latest version by default :
docker pull mysql
Specified version number
docker pull mysql:5.7
After the mirror image is pulled , Create with this image mysql example , Use the following command to create
sudo docker run \
-p 3306:3306 --name mysql \
-v /mydata/mysql/log:/var/log/mysql \
-v /mydata/mysql/data:/var/lib/mysql \
-v /mydata/mysql/conf:/etc/mysql \
-e MYSQL_ROOT_PASSWORD=root \
-d mysql:5.7
Configure port mapping :
-p 3306:3306 --name mysql
The container of 3306 Port mapping to host's 3306 port
To configure mysql Data volume mount
1.-v /mydata/mysql/log:/var/log/mysql( Log file mount )
Mount the log folder in the container to the corresponding /var/log/mysql In the folder
2.-v /mydata/mysql/data:/var/lib/mysql( Data file mount )
Mount the data folder in the container to the corresponding /var/lib/mysql In the folder
3.-v /mydata/mysql/conf:/etc/mysql( Profile mount )
Mount the configuration folder of the container to the corresponding /etc/mysql In the folder
Configure users
-e MYSQL_ROOT_PASSWORD=root
Set initialization root User's password
Specify mirror resources
-d mysql:5.7
-d: Run the instance in background mode
mysql:5.7: Specify to use this image to create a running instance
After the creation is successful, use the following command to view the created mysql example :
docker ps -a
边栏推荐
- 1-17 express Middleware
- 激发新动能 多地发力数字经济
- Development techniques - import files using easyexcel (simple example)
- Ssh server configuration file parameter permitrootlogin introduction
- Coefficient of variation method matlab code [easy to understand]
- Zaah Sultan looks at the old driver
- Analysis of doctor Aifen's incident
- 盘点华为云GaussDB(for Redis)六大秒级能力
- A comprehensive understanding of gout: symptoms, risk factors, pathogenesis and management
- Do a scrollbar thinking
猜你喜欢

Reading notes of Clickhouse principle analysis and Application Practice (3)

Look at the top 10 capabilities of alicloud cipu

盘点华为云GaussDB(for Redis)六大秒级能力

全面认识痛风:症状、风险因素、发病机理及管理

Summary of errors reported when using YML file to migrate CONDA environment

Open the jupyter notebook/lab and FAQ & settings on the remote server with the local browser

阿婆做的臭豆腐

Development techniques - import files using easyexcel (simple example)
![[untitled]](/img/42/47a8c8faaed33a1d9e864cb2ef7b72.png)
[untitled]

Jupyter notebook/lab switch CONDA environment
随机推荐
5G 在智慧医疗中的需求
What happens when word encounters an error while trying to open a file?
Troubleshooting the problem of pytorch geometric torch scatter and torch spark installation errors
1-17 express中间件
Random talk about Clickhouse join
PyTorch量化感知训练(QAT)步骤
5g demand in smart medicine
微服務鏈路風險分析
Excuse me, can I open an account for the company? Is it safe? All the answers you want are here
兴奋神经递质——谷氨酸与大脑健康
京东与腾讯续签三年战略合作协议;起薪涨至26万元,韩国三星SK争相加薪留住半导体人才;Firefox 102 发布|极客头条
1-14 express managed static resources
1-3 使用SQL管理数据库
Introduction to go web programming: a probe into the excellent test library gocovey
1-10 根据不同的url响应客户端的内容
《ClickHouse原理解析与应用实践》读书笔记(1)
程序员女友给我做了一个疲劳驾驶检测
Open the jupyter notebook/lab and FAQ & settings on the remote server with the local browser
微服务链路风险分析
1-11 创建线上文件服务