首页 > 数据库 >mysql在执行start slave命令时报错"ERROR 1872 (HY000)"

mysql在执行start slave命令时报错"ERROR 1872 (HY000)"

时间:2023-05-26 20:32:17浏览次数:60  
标签:slave Log ERROR HY000 SSL Master mysql master

问题描述:mysql在执行start slave命令时报错"ERROR 1872 (HY000)",如下所示:
数据库:mysql 8.0.27
系统:rhel 7.3
1、问题重现
mysql> start slave;
ERROR 1872 (HY000): Slave failed to initialize relay log info structure from the repository
2、异常原因
从库已经存在之前的relay log.
3、解决方案
使用reset slave语句,清除master信息和relay日志信息,并创建全新的中继日志.
mysql> stop slave;
Query OK, 0 rows affected, 2 warnings (0.00 sec)

mysql> reset slave;
Query OK, 0 rows affected, 1 warning (0.01 sec)

mysql> change master to master_host='192.168.133.111',master_user='repluser',master_password='123456',master_log_file='master_bin.000001',MASTER_LOG_POS=957;
Query OK, 0 rows affected, 8 warnings (0.02 sec)

mysql> start slave;
Query OK, 0 rows affected, 1 warning (0.01 sec)

mysql> show slave status \G
*************************** 1. row ***************************
               Slave_IO_State: Waiting for source to send event
                  Master_Host: 192.168.133.111
                  Master_User: repluser
                  Master_Port: 3306
                Connect_Retry: 60
              Master_Log_File: master_bin.000001
          Read_Master_Log_Pos: 957
               Relay_Log_File: relay-log.000002
                Relay_Log_Pos: 325
        Relay_Master_Log_File: master_bin.000001
             Slave_IO_Running: Yes
            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: 957
              Relay_Log_Space: 528
              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: 0
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: 3393dd41-fb9f-11ed-a80f-000c291140b1
             Master_Info_File: mysql.slave_master_info
                    SQL_Delay: 0
          SQL_Remaining_Delay: NULL
      Slave_SQL_Running_State: Replica has read all relay log; waiting for more updates
           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
         Replicate_Rewrite_DB: 
                 Channel_Name: 
           Master_TLS_Version: 
       Master_public_key_path: 
        Get_master_public_key: 1
            Network_Namespace: 
1 row in set, 1 warning (0.00 sec)

mysql> show warnings;
+---------+------+-------------------------------------------------------------------------------------------------------------------+
| Level   | Code | Message                                                                                                           |
+---------+------+-------------------------------------------------------------------------------------------------------------------+
| Warning | 1287 | 'SHOW SLAVE STATUS' is deprecated and will be removed in a future release. Please use SHOW REPLICA STATUS instead |
+---------+------+-------------------------------------------------------------------------------------------------------------------+
1 row in set (0.00 sec)

说明:如上所示,成功开启从库.

参考网址:https://blog.csdn.net/weixin_45412401/article/details/114795395

标签:slave,Log,ERROR,HY000,SSL,Master,mysql,master
From: https://blog.51cto.com/u_12991611/6358471

相关文章

  • MySQL: error code SQLState
      SQLSTATE-Wikipedia  ......
  • Python默认编码错误SyntaxError: Non-ASCII character '\xe5'之解决方法
    在编写Python时,当使用中文输出或注释时运行脚本,会提示错误信息:解决方法:python的默认编码文件是用的ASCII码,你将文件存成了UTF-8!!!(文件中存在中文或者其他语言,就会出现此问题!)解决办法很简单!!!在文件开头加入:# -*- coding: U......
  • Linxu解决systemctl启动服务失败,Error: No space left on device
    查看磁盘空间实际占用情况查看磁盘inodes占用情况这两部发现都没有问题。要是哪里发现被沾满了,直接删除解放空间。此篇是讲另一种情况。查看默认inotify的max_user_watches值[root@VM-4-4-centosnginx]#sysctlfs.inotifyfs.inotify.max_queued_events=16384fs.inotif......
  • How to fix CMake error Could not find a package configuration file provided by
    CMakeErrorat/usr/lib/x86_64-linux-gnu/cmake/Boost-1.71.0/BoostConfig.cmake:117(find_package):Couldnotfindapackageconfigurationfileprovidedby"boost_filesystem"(requestedversion1.71.0)withanyofthefollowingnames:boos......
  • FLEX实践—Error #1009 when use LinearAxis
    问题描述:FLEX应用中有三个states,通过下拉列表切换state,三个state中显示的控件分别为:datagrid,chart,datagrid/chart;当由只显示表格的视图切换到只显示图表的视图时,出现以下的错误:TypeError:Error#1009:无法访问空对象引用的属性或方法。atmx.charts.chartClasses::ChartLabel/upd......
  • unkonow internal error: Access violation - no RTTI data
    使用NavicatPremium12选择Mysql表时出现大量弹窗报错,导致sql文件执行不了,右键数据库执行外部文件也失败了。弹窗报错提示信息类似于:unkonowinternalerror:Accessviolation-noRTTIdata大概意思是提示非法访问,实际原因并不相关。真实原因疑似是其他查询窗口当时正在......
  • error CS0246: The type or namespace name ‘NetworkManager‘ could not be found
    项目场景:之前用Unity5.x开发的项目,要升级到Unity2019问题描述:因为项目中用到了老版的Network导致升级后报错errorCS0246:Thetypeornamespacename'NetworkManager'couldnotbefound(areyoumissingausingdirectiveoranassemblyreference?)<hrstyle="border:s......
  • ES启动错误 ERROR: the system property [es.path.conf] must be set
    JDK版本出问题。我的ElasticSearch版本为7.9.1,JDK版本为11对于不想修改系统JDK版本的可以使用elasticsearch自带的jdk启动服务。1.找到 elasticsearch-env.bat 中的if"%JAVA_HOME%"==""(setJAVA="%ES_HOME%\jdk\bin\java.exe"setJAVA_HOME="%ES_HOME%\jd......
  • value too long for type character(8) Call getNextException to see other errors
    字段内容超过数据库字段设置的长度导致的插入错误的提示信息如何定位是哪个字段长度不够长?mysql的话,错误提示信息有指示是究竟是哪个字段长度不够我这里用到的pgsql没有提示出问题的字段名,只能通过字段类型+长度来定位是哪个字段长度不够。以我上面报错的截图为例,出问题......
  • error C1083: 无法打开包括文件:“dxsdkver.h”: No such file or directory
    参考1:https://www.cnblogs.com/AI-Algorithms/p/3778527.html参考2:https://learn.microsoft.com/zh-cn/windows/win32/directx-sdk--august-2009-?redirectedfrom=MSDN参考3:https://www.microsoft.com/en-us/download/details.aspx?id=6812......