当前位置:网站首页>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
边栏推荐
- Golang 时间格式整理
- Delete the last character of the string in golang
- Easy touch plug-in
- Unity2019_ Natural ambient light_ Sky box
- 【音视频】ijkplayer错误码
- KunlunBase MeetUP 等您来!
- Unity one click AssetBundle
- 十六进制编码简介
- [audio and video] ijkplayer error code
- C language - Introduction - essence Edition - take you into programming (I)
猜你喜欢

Are you still watching the weather forecast on TV?

Puhua PLM empowers the whole scene product lifecycle management and helps the enterprise digital transformation of the main line of products
![[global product discovery 2] the first pure cloud augmented reality (AR) platform - Israel](/img/51/04f5a9dbd03438fbdf25545a81b7ba.jpg)
[global product discovery 2] the first pure cloud augmented reality (AR) platform - Israel

Student educational administration management system of C # curriculum design

matlab神經網絡所有傳遞函數(激活函數)公式詳解

Scite change background color

Jupyter remote server configuration and server startup

Minimap plug-in

璞华PLM为全场景产品生命周期管理赋能,助力产品主线的企业数字化转型

Shader foundation 01
随机推荐
unity2019_ Input management
Unity2019_ Natural ambient light_ Sky box
About the problem that the editor and the white screen of the login interface cannot be found after the location of unityhub is changed
Shader foundation 01
About Wireshark's unsuccessful installation of npcap
Haproxy+kept cluster setup 02
Lua hot update basic grammar
方正锐利重磅升级到12.0版本,包装印前处理更加便捷、高效!
Yolo series --- xml2txt script
Swagger document configuration
使用 FileChannel 进行文件的复制拷贝
Demonstration of plug-in use of ventuz basic series
Why can void * be a general pointer
oracle 插入单引号
php-fpm软件的安装+openresty高速缓存搭建
Maxcompute string splitting function -split_ PART
Exe file running window embedding QT window
Easy touch plug-in
[usaco12mar]cows in a skyscraper g (state compression DP)
C language - Introduction - essence Edition - take you into programming (I)