MySQL> show master status;
+------------------+-----------+--------------+------------------+-------------------+
| File | Position | Binlog_Do_DB | Binlog_Ignore_DB | Executed_Gtid_Set |
+------------------+-----------+--------------+------------------+-------------------+
| mysql-bin.000003 | 290903331 | | | |
+------------------+-----------+--------------+------------------+-------------------+
1 row in set (0.00 sec)
mysql> reset master;
Query OK, 0 rows affected (0.28 sec)
mysql> show slave status\G;
*************************** 1. row ***************************
Slave_IO_State: Reconnecting after a failed master event read
Master_Host: xxx.xxx.xxx.xxx
Master_User: slavexxx
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql-bin.000004
Read_Master_Log_Pos: 18841739
Relay_Log_File: local-relay-bin.000022
Relay_Log_Pos: 4799132
Relay_Master_Log_File: mysql-bin.000004
Slave_IO_Running: Connecting
Slave_SQL_Running: Yes
Replicate_Do_DB:
Replicate_Ignore_DB:
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
Last_Errno: 0
Last_Error:
Skip_Counter: 0
Exec_Master_Log_Pos: 18841739
Relay_Log_Space: 5297368
Until_Condition: None
Until_Log_File:
Until_Log_Pos: 0
Master_SSL_Allowed: No
Master_SSL_CA_File:
Master_SSL_CA_Path:
Master_SSL_Cert:
Master_SSL_Cipher:
Master_SSL_Key:
Seconds_Behind_Master: NULL
Master_SSL_Verify_Server_Cert: No
Last_IO_Errno: 2003
Last_IO_Error: error reconnecting to master 'slavexxx@xxx.xxx.xxx.xxx:3306' - retry-time: 60 retries: 938
Last_SQL_Errno: 0
Last_SQL_Error:
Replicate_Ignore_Server_Ids:
Master_Server_Id: 1
Master_UUID: fa8d6da3-a285-11e2-a150-00265518b2bb
Master_Info_File: /mysqldata/master.info
SQL_Delay: 0
SQL_Remaining_Delay: NULL
Slave_SQL_Running_State: Slave has read all relay log; waiting for the slave I/O thread to update it
Master_Retry_Count: 86400
Master_Bind:
Last_IO_Error_Timestamp: 131024 09:31:40
Last_SQL_Error_Timestamp:
Master_SSL_Crl:
Master_SSL_Crlpath:
Retrieved_Gtid_Set:
Executed_Gtid_Set:
Auto_Position: 0
1 row in set (0.00 sec)
ERROR:
No query specified
mysql> stop slave;
Query OK, 0 rows affected (0.06 sec)
mysql> reset slave;
Query OK, 0 rows affected (0.11 sec)
mysql> show slave status\G;
*************************** 1. row ***************************
Slave_IO_State:
Master_Host: xxx.xxx.xxx.xxx
Master_User: slavexxx
Master_Port: 3306
Connect_Retry: 60
Master_Log_File:
Read_Master_Log_Pos: 4
Relay_Log_File: local-relay-bin.000001
Relay_Log_Pos: 4
Relay_Master_Log_File:
Slave_IO_Running: No
Slave_SQL_Running: No
Replicate_Do_DB:
Replicate_Ignore_DB:
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
Last_Errno: 0
Last_Error:
Skip_Counter: 0
Exec_Master_Log_Pos: 0
Relay_Log_Space: 143
Until_Condition: None
Until_Log_File:
Until_Log_Pos: 0
Master_SSL_Allowed: No
Master_SSL_CA_File:
Master_SSL_CA_Path:
Master_SSL_Cert:
Master_SSL_Cipher:
Master_SSL_Key:
Seconds_Behind_Master: NULL
Master_SSL_Verify_Server_Cert: No
Last_IO_Errno: 0
Last_IO_Error:
Last_SQL_Errno: 0
Last_SQL_Error:
Replicate_Ignore_Server_Ids:
Master_Server_Id: 1
Master_UUID: fa8d6da3-a285-11e2-a150-00265518b2bb
Master_Info_File: /mysqldata/master.info
SQL_Delay: 0
SQL_Remaining_Delay: NULL
Slave_SQL_Running_State:
Master_Retry_Count: 86400
Master_Bind:
Last_IO_Error_Timestamp:
Last_SQL_Error_Timestamp:
Master_SSL_Crl:
Master_SSL_Crlpath:
Retrieved_Gtid_Set:
Executed_Gtid_Set:
Auto_Position: 0
1 row in set (0.00 sec)
ERROR:
No query specified

一些同步的信息还在,其实执行reset slave,其实是把master.info和relay-log.info文件给删除,但里面的同步信息还在,那么可以用这个方法,让其清除的彻彻底底。

[root@localhost mysqldata]# ls
auto.cnf dxmonitor dxstatistics ibdata1 ib_logfile1 localhost.err master.info mysql-bin.000001 mysqld_safe.pid relay-log.info test
discoverworkflow dxstatbak faxian.err ib_logfile0 ibtmp1 localhost.pid mysql mysql-bin.index performance_schema similarityanalysis zeus
[root@localhost mysqldata]# ls
auto.cnf dxmonitor dxstatistics ibdata1 ib_logfile1 localhost.err mysql mysql-bin.index performance_schema test
discoverworkflow dxstatbak faxian.err
mysql> reset slave all;
ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id: 1227
Current database: *** NONE ***
Query OK, 0 rows affected (0.00 sec)
mysql> show slave status\G;
Empty set (0.00 sec)
ERROR:
No query specified
mysql>

如何干净的清除Slave同步信息的更多相关文章

  1. RESET MASTER和RESET SLAVE使用场景和说明,以及清除主从同步关系

    mysql主从复制中,需要将从库提升为主库,需要取消其从库角色,这可通过执行RESET SLAVE ALL清除从库的同步复制信息.包括连接信息和二进制文件名.位置.从库上执行这个命令后,使用show ...

  2. 10gR2-11gR1,11gR2如何干净的清除并重建OCR和表决磁盘

    下面分别讨论10gR2-11gR1和11gR2干净的清除并重建OCR和表决磁盘的方法. 一.10gR2-11gR1干净的清除并重建OCR和表决磁盘的方法 参考METALINK文章:ID 399482. ...

  3. Spring Security怎样不让默认的ProviderManager清除密码等信息

    <authentication-manager erase-credentials="false"> ... </authentication-manager&g ...

  4. 清除windows激活信息

    1.管理员运行命令提示符 在命令提示符中输入 slmgr /upk---删除当前KMS密匙 出现"成功地卸载了产品密匙"后,继续依次执行下面两个命令 slmgr /ckms---此 ...

  5. 11.16-18 lsci、ipcs、ipcrm:清除ipc相关信息

    lspci:显示所有PCI设备 lspci命令用来显示系统中的所有PCI总线设备或是连接到该总线上的所有设备. lspci命令的参数选项及说明 -v     显示详细信息 -vv    显示更详细的信 ...

  6. MySQL 清除从库同步信息

    实际的业务生产系统中,mysql从库有时候会根据实际需求变更为主库,这时候我们需要清除掉从库配置的主从信息登录从库执行以下命令:mysql> stop slave;mysql> reset ...

  7. mysql5.7主从(Master/Slave)同步配置

    环境: mysql版本都是5.7(以前的版本配置可能不一样) 主(Master) windows:192.168.0.68 从(Slave) centos7:192.168.0.4 基本环境配置: 要 ...

  8. 如何查看和清除svn登录信息

    切换svn登录用 点击clear,出现用户信息,勾选后点击ok 即清除 .下次访问svn需要重新登录

  9. mysql的master和slave同步方案

    同步原理 master将改变记录到二进制日志(binary log)中 slave将master的binary log events拷贝到它的中继日志(relay log) slave重做中继日志中的 ...

随机推荐

  1. Vue2.0 分页插件pagination使用详细说明

    Vue2.0 分页pagination使用 插件下载地址:Vue_Pagination 插件描述:基于jQuery的分页插件大家都用过很多了吧,今天分享一下基于Vue的分页插件pagination.j ...

  2. Linux系统nat模式联网——VM是12 系统是cantos7

    >点击还原默认设置,然后确定 >选择Vmnet8,VMnet信息自动选中NAT模式 记住子网IP和子网掩码 >点击NAT设置,记住网关IP >点击DHCP.记住IP范围 > ...

  3. HttpWebRequest.Connection的问题

    HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://localhost/");request.Co ...

  4. 记录几个ubuntu环境下的php相关的路径

    php路径 /usr/bin/php phpize5 /usr/bin/phpize5 php5-fpm /usr/sbin/php5-fpm php所有的配置文件 /etc/php5/fpm 重启p ...

  5. B树就想到这个

    比如要查找60 先在根结点中查,根结点里面有 17  35这2个关键字, 60 > 35,则从右边开始查找 p3指针开始查找 ,  到了第二层的最右边的那个结点开始查找 , 里面有  65  8 ...

  6. C语言屏幕打印,再删除打印的内容

    在做项目的时候,用到了命令行模式进行监听数据,并且是多线程的.因为程序大部分时间都只是在监听状态,容易给人假死的信息.所以单独使用一个进行在屏幕上打印省略号(.......),然后再把打印的省略号(. ...

  7. 【转】每天一个linux命令(32):gzip命令

    原文网址:http://www.cnblogs.com/peida/archive/2012/12/06/2804323.html 减少文件大小有两个明显的好处,一是可以减少存储空间,二是通过网络传输 ...

  8. 更新上篇文章 调用三级目录文章内容 dede频道页实现三级栏目嵌套调用文章

    原文:http://www.wuaie.com/?p=66 源码改写 $typeid = $row['id']; if((class_exists('PartView'))) { $pv = new ...

  9. .gitignore 存放位置

    放在仓库根目录下即可.比如你的仓库在“D:\MYREPO”,位置就是“D:\MYREPO\.gitignore”. 模板可从GITHUB上COPY一份.

  10. qt 中文乱码

    首先呢,声明一下,QString 是不存在中文支持问题的,很多人遇到问题,并不是本身 QString 的问题,而是没有将自己希望的字符串正确赋给QString. 很简单的问题,"我是中文&q ...