当前位置:网站首页> docker中mysql开启日志的实现步骤
docker中mysql开启日志的实现步骤
2022-07-06 15:36:00 【1024问】
1.查看安mysql容器状态
2.进入容器内部
3.登录mysql数据库
4.查看binlog日志是否开启,查看后关闭mysql
5.编辑配置文件开启binlog,设置log文件
6.退出容器
7.重启mysql容器,且查看是否启动成功
8.查看binlog 日志状态是否开启
9.查看日志
1.查看安mysql容器状态 docker ps
docker exec -it 4ae9238c176a /bin/bash
mysql -uroot -p123456
查看:show variables like 'log_bin';
关闭:exit

备注:ON开启日志,OFF关闭日志
5.编辑配置文件开启binlog,设置log文件5.1 先在 /etc 文件夹下查找到 mysqld.cnf文件路径
find /etc -name mysqld.cnf
5.2 编辑mysqld.cnf文件
vim /etc/mysql/mysql.conf.d/mysqld.cnf
备注:如果没有vim 编译器 先安装vim编译器
apt-get updateapt-get install vim 备注:保证general_log_file 路径存在,(这是我的路径)若没有 则路径配置参考上面的log_error的配置路径
备注:添加后注意保存,保存,保存
6.退出容器exit
docker restart 4ae9238c176adocker ps
docker exec -it 4ae9238c176a /bin/bashmysql -uroot -p123456show variables like 'log_bin';exit

到此这篇关于docker中mysql开启日志的实现步骤的文章就介绍到这了,更多相关docker mysql开启日志内容请搜索软件开发网以前的文章或继续浏览下面的相关文章希望大家以后多多支持软件开发网!
边栏推荐
猜你喜欢

Introduction to network basics

机试刷题1

专为决策树打造,新加坡国立大学&清华大学联合提出快速安全的联邦学习新系统

UE4蓝图学习篇(四)--流程控制ForLoop和WhileLoop

监控界的最强王者,没有之一!

(18) LCD1602 experiment

Thinkphp5 multi table associative query method join queries two database tables, and the query results are spliced and returned

config:invalid signature 解决办法和问题排查详解

Unified Focal loss: Generalising Dice and cross entropy-based losses to handle class imbalanced medi

Traversal of a tree in first order, middle order, and then order
随机推荐
【编译原理】做了一半的LR(0)分析器
2014阿里巴巴web前实习生项目分析(1)
Leetcode: interview question 17.24 Maximum cumulative sum of submatrix (to be studied)
CUDA exploration
memcached
Unified Focal loss: Generalising Dice and cross entropy-based losses to handle class imbalanced medi
Clip +json parsing converts the sound in the video into text
儿童睡衣(澳大利亚)AS/NZS 1249:2014办理流程
TypeScript获取函数参数类型
Unified Focal loss: Generalising Dice and cross entropy-based losses to handle class imbalanced medi
ThreadLocal详解
案例推荐丨安擎携手伙伴,保障“智慧法院”更加高效
Puppeteer连接已有Chrome浏览器
CocosCreator+TypeScripts自己写一个对象池
DockerMySQL无法被宿主机访问的问题解决
OpenSSL:适用TLS与SSL协议的全功能工具包,通用加密库
服务器的系统怎么选者
#DAYU200体验官# 首页aito视频&Canvas绘制仪表盘(ets)
C# 三种方式实现Socket数据接收
Balanced Multimodal Learning via On-the-fly Gradient Modulation(CVPR2022 oral)