当前位置:网站首页>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
边栏推荐
猜你喜欢

Inventory the six second level capabilities of Huawei cloud gaussdb (for redis)

Introduction to go web programming: a probe into the excellent test library gocovey

The programmer's girlfriend gave me a fatigue driving test
Testing media cache

顺祝老吴的聚会

jenkins下载插件下载不了,解决办法

JD and Tencent renewed the three-year strategic cooperation agreement; The starting salary rose to 260000 yuan, and Samsung sk of South Korea scrambled for a raise to retain semiconductor talents; Fir

看阿里云 CIPU 的 10 大能力

阿婆做的臭豆腐
![[untitled]](/img/42/47a8c8faaed33a1d9e864cb2ef7b72.png)
[untitled]
随机推荐
Troubleshooting the problem of pytorch geometric torch scatter and torch spark installation errors
clickhouse原生监控项,系统表描述
【无标题】第一次参加csdn活动
做一个 Scrollbar 的思考
阿婆做的臭豆腐
VIM common shortcut keys
Rethink healthy diet based on intestinal microbiome
PyTorch量化感知训练(QAT)步骤
1-19 利用CORS解决接口跨域问题
Three techniques for reducing debugging time of embedded software
Ssh server configuration file parameter permitrootlogin introduction
pytorch geometric torch-scatter和torch-sparse安装报错问题解决
Notes [introduction to JUC package and future]
机器学习中如何使用数据集?
The programmer's girlfriend gave me a fatigue driving test
1-14 express托管静态资源
The Jenkins download Plug-in can't be downloaded. Solution
1-10 respond to client content according to different URLs
vim 常用快捷键
Neurotransmetteurs excitateurs - glutamate et santé cérébrale