当前位置:网站首页>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';边栏推荐
- 禁用右击、键盘打开控制台事件
- Learning Tai Chi Maker - mqtt Chapter II (VI) mqtt wills
- Study on chemical properties and technology of biovendor rage ELISA Kit
- Store inventory management system source code
- 交流电和直流电的区别是什么?
- 【SkyWalking】一口气学完分布式链路追踪SkyWalking
- How to do a good job of gateway high availability protection in the big promotion scenario
- When excel copies the contents of a row, the columns are separated by the tab "\t"
- Where does the storm go? Whose pot is the weather forecast wrong?
- LeetCode 88:合并两个有序数组
猜你喜欢

Carboxylic acid study: lumiprobe sulfoacyanine 7 dicarboxylic acid

Store inventory management system source code

Voltage mode and current mode control of switching power supply

Latest Windows version 5.0.14 of redis

Performance optimization and implementation of video codec

The short video local life section has become popular. How to grasp the new opportunities?
![[csp-j2020] excellent splitting](/img/05/90f9cf71791b3cdc37073eaf5db989.png)
[csp-j2020] excellent splitting

Don't roll! How to reproduce a paper with high quality?

Mask's miserable and inspirational childhood, who is introverted by campus violence

Learn Taiji Maker - mqtt Chapter 2 (IV) esp8266 reserved message application
随机推荐
JS text box loses focus to modify width text and symbols
2022年安全员-B证考试题库及答案
【SkyWalking】一口气学完分布式链路追踪SkyWalking
How high is the gold content of grade II cost engineer certificate? Just look at this
Analysis of distributed transaction solution Seata golang
Simulation questions and answers of the latest national fire-fighting facility operators (primary fire-fighting facility operators) in 2022
Congratulations to myself, official account has more than ten thousand fans
吴恩达深度学习测验题:deeplearning.ai-week1-quiz
Operation of simulated examination platform of G3 boiler water treatment recurrent training question bank in 2022
PCR/qPCR研究:Lumiprobe丨dsGreen 用于实时 PCR
mysql----where 1=1是什么意思
学习太极创客 — MQTT 第二章(四)ESP8266 保留消息应用
2022烟花爆竹经营单位安全管理人员特种作业证考试题库及模拟考试
【JVM系列】JVM调优
!‘cat‘ 不是内部或外部命令,也不是可运行的程序 或批处理文件。
DH parameters of robotics and derivation using MATLAB symbolic operation
LeetCode 88:合并两个有序数组
高通平台 Camera 之 MCLK 配置
C语言中函数是什么?编程中的函数与数学中的函数区别?理解编程语言中的函数
Based on the order flow tool, what can we see?