当前位置:网站首页>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
边栏推荐
- Open the jupyter notebook/lab and FAQ & settings on the remote server with the local browser
- 1-12 preliminary understanding of Express
- Clickhouse native monitoring item, system table description
- Export El table as is to excel table
- 1-15 nodemon
- FreeRTOS record (IX. an example of a bare metal project transferring to FreeRTOS)
- 1-13 express监听GET和POST请求&处理请求
- jupyterbook 清空控制台输出
- Analysis of doctor Aifen's incident
- 开发属于自己的包
猜你喜欢
全面认识痛风:症状、风险因素、发病机理及管理
Pytorch quantitative practice (2)
《ClickHouse原理解析与应用实践》读书笔记(3)
京东与腾讯续签三年战略合作协议;起薪涨至26万元,韩国三星SK争相加薪留住半导体人才;Firefox 102 发布|极客头条
Testing media cache
周少剑,很少见
clickhouse原生監控項,系統錶描述
Excitatory neurotransmitter glutamate and brain health
Development techniques - import files using easyexcel (simple example)
pytorch geometric torch-scatter和torch-sparse安装报错问题解决
随机推荐
机器学习工作要求研究生吗?
1-18 创建最基本的express服务器&创建路由的API模块
ceshi deces
【回溯】全排列 II leetcode47
1-15 nodemon
qsort函数和模拟实现qsort函数
[backtracking] full arrangement leetcode46
Excuse me, can I open an account for the company? Is it safe? All the answers you want are here
Introduction and example of template method mode
1-11 创建线上文件服务
1-14 express托管静态资源
Jupyter notebook/lab switch CONDA environment
Installing jupyter notebook under Anaconda
Summary of errors reported when using YML file to migrate CONDA environment
1-13 express监听GET和POST请求&处理请求
What does grade evaluation mean? What is included in the workflow?
Do a scrollbar thinking
吴恩达的机器学习适合入门吗?
“信任机器”为发展赋能
《ClickHouse原理解析与应用实践》读书笔记(3)