当前位置:网站首页>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';边栏推荐
- C语言中函数是什么?编程中的函数与数学中的函数区别?理解编程语言中的函数
- Excel将一行的内容进行复制时,列与列之间是用制表符“\t”进行分隔的
- 使用class toplevel的messagebox时,窗口弹出问题。
- sqlmap工具使用手册
- 2022烟花爆竹经营单位安全管理人员特种作业证考试题库及模拟考试
- 摄像头基础知识
- 吴恩达深度学习测验题:deeplearning.ai-week1-quiz
- Simulation questions and answers of the latest national fire-fighting facility operators (primary fire-fighting facility operators) in 2022
- 几百行代码实现一个脚本解释器
- Store inventory management system source code
猜你喜欢

Extjs图书管理系统源码 智能化图书管理系统源码

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

?位置怎么写才能输出true

Carboxylic acid study: lumiprobe sulfoacyanine 7 dicarboxylic acid

LeetCode 88:合并两个有序数组

大促场景下,如何做好网关高可用防护

活性染料研究:Lumiprobe AF594 NHS 酯,5-异构体

Binary sort tree: BST

店铺进销存管理系统源码
![[early knowledge of activities] list of recent activities of livevideostack](/img/aa/8b14f9863cd675a7be06a0c3855a93.png)
[early knowledge of activities] list of recent activities of livevideostack
随机推荐
QCOM LCD调试
109. simple chat room 12: realize client-side one-to-one chat
Lumiprobe cell imaging analysis: PKH26 cell membrane labeling kit
Biovendor sRAGE antibody solution
CI & CD must be known!
Unity out ref params
Performance optimization and implementation of video codec
[microservices openfeign] openfeign quick start service invocation based on feign
摄像头基础知识
判断对象中是否存在某一个属性
使用class toplevel的messagebox时,窗口弹出问题。
wordpress zibll子比主题6.4.1开心版 免授权
A doctor's 22 years in Huawei (full of dry goods)
IP数据报的发送和转发过程
Is it enough for the project manager to finish the PMP? no, it isn't!
Pcr/qpcr research: lumiprobe dsgreen is used for real-time PCR
lotus v1.16.0 calibnet
Dart学习——函数、类
Unity out ref params
Reactive dye research: lumiprobe af594 NHS ester, 5-isomer