删除mysql relay-log 的解决办法
来源:程序员人生 发布时间:2014-08-08 18:28:33 阅读次数:5675次
删除mysql relay-log 的解决办法
使用下面命令
- ysql# cd data
- data# rm -rf *relay*
- #mysql -uroot -p
- mysql> stop slave
执行一段时间后......
mysql>start slave
mysql>show slave status\G;
会发现有错误存在。。
解决办法 。
通过查看日志 找到同步的pos 和bin-log然后
重新change master to
- >master_host='',
- >master_port='',
- >master_user='',
- >master_password='',
- >master_log_file='',
- >master_log_pos='';
然后在主上:
flush tables with read lock;
show master status;
看到当前日志和偏移量
在slave 上运行
select master_wait_pos('logfile',offset)
主上unlock tables;
或者走完下面的命名也可以清除
- show slave status\G
- stop slave,
- change master to master_host='x.x.x.x',master_user='x',master_password='x',master_port=3306,master_log_file='mysql-bin.000109',master_log_pos=77074041;
生活不易,码农辛苦
如果您觉得本网站对您的学习有所帮助,可以手机扫描二维码进行捐赠