mysql bin log配置及查看
2024-10-20 05:29:10
一、mysql bin日志配置:
查案命令:show variables like '%log_bin%'
log_bin:on
log_bin_basename:bin文件路径及名前缀(/var/log/mysql/mysql-bin)
log_bin_index:bin文件index(/var/log/mysql/mysql-bin.index)
server_id:n
生成的bin日志格式如下:
mysql-bin.000000 mysql-bin.000001
二、日志查看命令:
转换格式
mysqlbinlog mysql-bin.000000 > mysql-bin.000000.txt
日志内容:
use `dbname`/*!*/;
SET TIMESTAMP=/*!*/; //开始时间
insert into `users` (`userId`, `userName`) values ('', 'helly') //操作sql
/*!*/;
# at 38524047
#170122 :: server id end_log_pos 38524078 CRC32 0xe8f99830 Xid = 23583291 //服务器id
COMMIT/*!*/;
# at 38524078
#170122 14:00:22 server id 1 end_log_pos 38524167 CRC32 0x64c7f33a Query thread_id=63112 exec_time=0 error_code=0
SET TIMESTAMP=1485064822/*!*/;
BEGIN
/*!*/;
# at 38524167
#170122 14:00:22 server id 1 end_log_pos 38524482 CRC32 0x3ff38ff2 Query thread_id=63112 exec_time=0 error_code=0
SET TIMESTAMP=1485064822/*!*/;
users update `` set `userName` = 'heheli' where `userId` = ''
/*!*/;
# at 38524482
最新文章
- win10 64位专业版系统中显示32位dcom组件配置的方法
- Bungee Jumping[HDU1155]
- struct和typedef struct彻底明白了
- Hadoop启动报Error: JAVA_HOME is not set and could not be found解决办法
- [51单片机] TFT2.4彩屏1 [文字显示 画矩形]
- [moka同学笔记]yii2.0导航栏
- tp三大自动
- CMOS and BIOS
- HTML要点(五)<;iframe>;标签
- GridLookUpEdit 简单应用
- 2016.08.06计算几何总结测试day1
- Python之旅.第三章.函数3.28
- jQuery的JS库在本地运行项目时提示无法加载
- git 配置别名
- 微信小程序使用三元表达式切换图片
- bzoj5068: 友好的生物
- 苹果Mac OS系统修改Hosts文件的方法
- 揭开AutoRun功能的神秘面纱
- xgboost使用
- 详解 MNIST 数据集