标签:必须 需要 处理 replicat .sql 恢复 配置 show stat
log_bin = /var/log/mysql/mysql_bin.log
server-id = 1
(必须有,否则重启fail)log_bin = /var/log/mysql/mysql-bin.log
service mysql restart | /etc/init.d/mysql restart
可登陆数据库查看是否启用binlog:
show variables like "log_%";
查看当前正在写入的binlog日志:
show master status;
grant REPLICATION CLIENT ON *.* TO user;
mysqldump -F -uxxx -p --databases anheisg > /home/dw/backup/anheisg.sql
show master status;
查看当前正在写入的binlog日志,如mysql-bin.000005mysql -udw -pxxx anheisg < /home/dw/backup/anheisg.sql
flush logs;
将数据库的修改写入新的binlog日志,这样便于查看和处理mysql-bin.000005show binlog events in ‘mysql-bin.000005‘;
查看错误操作的pos和end_posmysqlbinlog --no-defaults /var/log/mysql/mysql_bin.000005 --stop-position=878 | mysql -uroot -p anheisg
mysqlbinlog --no-defaults /var/log/mysql/mysql_bin.000005 -d anheisg > anheihei.sql
mysql -udw -pxxx anheisg < anheihei.sql
标签:必须 需要 处理 replicat .sql 恢复 配置 show stat
原文地址:https://www.cnblogs.com/liushi-Oscar/p/9577511.html