当前位置:网站首页>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
边栏推荐
- Unity performance optimization
- KunlunBase MeetUP 等您来!
- Basic operation and process control
- Mutual call between Lua and C #
- 数据的存储
- [set theory] order relation (the relation between elements of partial order set | comparable | strictly less than | covering | Haas diagram)
- unity2019_ Input management
- 链式长取值
- 【音视频】ijkplayer错误码
- Viz artist advanced script video tutorial -- stringmap use and vertex operation
猜你喜欢

Kwai 20200412 recruitment

Abstract classes and interfaces

Use of ue5 QRcode plug-in

Clion toolchains are not configured configure disable profile problem solving

the installer has encountered an unexpected error installing this package

Kunlunbase meetup is waiting for you!

the installer has encountered an unexpected error installing this package

Jupyter remote server configuration and server startup

the installer has encountered an unexpected error installing this package

Transfinite hacker cognition
随机推荐
【云原生】微服务之Feign的介绍与使用
[usaco12mar]cows in a skyscraper g (state compression DP)
Golang中删除字符串的最后一个字符
My touch screen production "brief history" 2
JSON与Object之间转换
Initial unity
Zohocrm deluge function application time verification
Storage of data
链式长取值
Sequence of map implementation classes
Conversion between string and int types in golang
MaxCompute字符串分割函数-SPLIT_PART
YOLO系列 --- xml2txt脚本
Ventuz Foundation Series "one step at the door"
Use of ue5 QRcode plug-in
[USACO12MAR]Cows in a Skyscraper G(状态压缩dp)
WPF:解决MaterialDesign:DialogHost 无法关闭问题
Editor Extensions
oracle中的 (+)是什么意思
Maxcompute string splitting function -split_ PART