MySQL8练习基础SQL脚本代码(一)

一、日志相关

-- 查看MySQL是否开启了binlog日志

show variables like 'log_bin';

-- 查看binlog日志的格式

show variables like 'binlog_format';

-- 查看所有日志

show binlog events;

-- 查看最新的日志

show master status;

-- 查询指定的binlog日志

show binlog events in 'binlog.000010';

-- 从指定的位置开始,查看指定的Binlog日志

show binlog events in 'binlog.000010' from 156;