当前位置:网站首页>MySQL containerization (1) docker installation MySQL
MySQL containerization (1) docker installation MySQL
2022-07-03 08:20:00 【wangleleb】
1. Containerized MySQL The problem of
docker The container actually adds a read-write layer based on the image , When the container is deleted , The data state maintained by the container will be lost , about MySQL Such persistent data storage is catastrophic , At this time, the data persistence of the container is very necessary .
2. How to achieve persistence
In the last blog Docker Persistence It has been introduced in detail in , Readers can refer to .
3.MySQL Data source file for
Mysql Data files are generally stored in by default /var/lib/myql
Next , The folders correspond to each database
# Among them wordpress The folder is my name wordpress Corresponding database
[email protected]:/var/lib/mysql# cd /var/lib/mysql && ls
auto.cnf client-key.pem ibdata1 private_key.pem sys
ca-key.pem ib_buffer_pool ibtmp1 public_key.pem wordpress
ca.pem ib_logfile0 mysql server-cert.pem
client-cert.pem ib_logfile1 performance_schema server-key.pem
Access to database
[email protected]:/var/lib/mysql# cd wordpress/ && ls
db.opt wp_options.frm wp_term_relationships.ibd wp_usermeta.frm
wp_commentmeta.frm wp_options.ibd wp_term_taxonomy.frm wp_usermeta.ibd
wp_commentmeta.ibd wp_postmeta.frm wp_term_taxonomy.ibd wp_users.frm
wp_comments.frm wp_postmeta.ibd wp_termmeta.frm wp_users.ibd
wp_comments.ibd wp_posts.frm wp_termmeta.ibd
wp_links.frm wp_posts.ibd wp_terms.frm
wp_links.ibd wp_term_relationships.frm wp_terms.ibd
[email protected]:/var/lib/mysql/wordpress#
Among them .frm
The file is a table structure file .
Among them .ibd
The file is a table data file .
4. adopt volume Realize database data persistence
- establish mysql Data volume
- establish mysql configure volumes ( Turn on binlog etc. )
- establish mysql Journal volume ( produce mysql journal )
docker volume create mysql-data \
docker volume create mysql-config \
docker volume create mysql-log
docker run -d -p 3306:3306 \
--name mysql \
-v mysql-data:/var/lib/mysql \
-v mysql-config:/etc/mysql/conf.d \
-v mysql-log:/var/log/mysql \
-e MYSQL_ROOT_PASSWORD=131452 \
mysql:5.7
Be careful : About Docker Persistent reference post
边栏推荐
- Kunlunbase meetup is waiting for you!
- Easy touch plug-in
- Go resolve ID card
- Golang 时间格式整理
- Jupyter remote server configuration and server startup
- 数据分析练习题
- Image processing 8-cnn image classification
- Exe file running window embedding QT window
- Are you still watching the weather forecast on TV?
- GIS实战应用案例100篇(七十八)-多规合一数据库设计及数据入库
猜你喜欢
[global product discovery 2] the first pure cloud augmented reality (AR) platform - Israel
Puhua PLM empowers the whole scene product lifecycle management and helps the enterprise digital transformation of the main line of products
Haproxy+kept cluster setup 02
MAE
animation
My touch screen production "brief history" 1
Detailed explanation of all transfer function (activation function) formulas of MATLAB neural network
Scite change background color
Solution détaillée de toutes les formules de fonction de transfert (fonction d'activation) du réseau neuronal MATLAB
璞华PLM为全场景产品生命周期管理赋能,助力产品主线的企业数字化转型
随机推荐
C语言-入门-精华版-带你走进编程(一)
P1596 [USACO10OCT]Lake Counting S
Three characteristics
Unity dotween sequence animation replay problem.
Exe file running window embedding QT window
P2704 [NOI2001] 炮兵阵地(状压dp)
【音视频】ijkplayer错误码
Basic operation and process control 2
About the problem that the editor and the white screen of the login interface cannot be found after the location of unityhub is changed
Map的实现类的顺序性
[end of 2021] National Meteorological Short Video (Kwai, Tiktok) influence list in December
String class
Youyou1 of xlua knapsack system
ArrayList
Redis的数据结构
Maxcompute string splitting function -split_ PART
About Wireshark's unsuccessful installation of npcap
Free use until 2015 -- viz artist multi touch plug-in package
Unity performance optimization
GIS实战应用案例100篇(七十八)-多规合一数据库设计及数据入库