当前位置:网站首页>Docker安装Mysql5.7并开启binlog
Docker安装Mysql5.7并开启binlog
2022-06-28 05:08:00 【qq_41084438】
安装
docker pull mysql:5.7创建存放映射文件夹
mkdir -p /mydata/mysql/log
mkdir -p /mydata/mysql/data
mkdir -p /mydata/mysql/conf运行mysql
docker run --name mysql5.7 -e MYSQL_ROOT_PASSWORD=123456 -d -v /mydata/mysql/log:/var/log/mysql -v /mydata/mysql/data:/var/lib/mysql -v /mydata/mysql/conf:/etc/mysql -p 8001:3306 mysql:5.7
开启binlog(5.7默认不开启,8默认开启)
新建两个配置文件
cd /mydata/mysql/conf
touch my.cnf
touch my.conf注意my.cnf的权限不能开太大,不让会被mysql忽略
chmod 664即可,开777会被忽略
![]()
修改配置文件
1、my.conf文件
vim my.conf[client]
default-character-set=utf8
[mysql]
default-character-set=utf8
[mysqld]
init_connect='SET collation_connection = utf8_unicode_ci'
init_connect='SET NAMES utf8'
character-set-server=utf8
collation-server=utf8_unicode_ci
skip-character-set-client-handshake
skip-name-resolve:wq!2、my.cnf
vim my.cnf[mysqld]
log-bin=/var/lib/mysql/mysql-bin
server-id=123654
expire_logs_days = 30:wq!重启mysql
docker restart mysql5.7验证

show variables like 'log_bin';
show variables like 'binlog_format';边栏推荐
- Simulation questions and answers of the latest national fire-fighting facility operators (primary fire-fighting facility operators) in 2022
- [csp-j2020] excellent splitting
- Analysis of distributed transaction solution Seata golang
- Hundreds of lines of code to implement a script interpreter
- Latest Windows version 5.0.14 of redis
- Interview: what are the similarities and differences between abstract classes and interfaces?
- 交流电和直流电的区别是什么?
- Unity out ref params
- Lumiprobe cell imaging analysis: PKH26 cell membrane labeling kit
- 2022 low voltage electrician examination questions and answers
猜你喜欢

学习太极创客 — MQTT 第二章(五)心跳机制

二级造价工程师考试还没完?还有资格审核规定!

Lumiprobe cell imaging analysis: PKH26 cell membrane labeling kit

分享一个因子挖掘的利器:遗传规划

并发之wait/notify说明

IP datagram sending and forwarding process

Dart学习——函数、类

JS 文本框失去焦点修改全半角文字和符号

Voltage mode and current mode control of switching power supply

Carboxylic acid study: lumiprobe sulfoacyanine 7 dicarboxylic acid
随机推荐
Distributed transaction - Final consistency scheme based on message compensation (local message table, message queue)
Audio and video technology development weekly
开关电源电压型与电流型控制
别卷!如何高质量地复现一篇论文?
Study on chemical properties and technology of biovendor rage ELISA Kit
穿越封锁的最新利器,速度最快梯没有之一。
Opencv实现颜色检测
程序员-放羊娃
Sorting out some topics of modern exchange principle MOOC
Unity delegate
Flexible IP network test tool -- x-launch
cgo+gSoap+onvif学习总结:8、arm平台交叉编译运行及常见问题总结
吴恩达深度学习测验题:deeplearning.ai-week1-quiz
学习太极创客 — MQTT 第二章(五)心跳机制
msa.h:没有那个文件或目录
Metartc5.0 API programming guide (I)
Realizing color detection with OpenCV
电源插座是如何传输电的?困扰小伙伴这么多年的简单问题
Biovendor sRAGE antibody solution
改性三磷酸盐研究:Lumiprobe氨基-11-ddUTP