首页 > 数据库 >mysql从库执行同步后,查看状态显示"Authentication requires secure connection"异常

mysql从库执行同步后,查看状态显示"Authentication requires secure connection"异常

时间:2023-05-28 20:31:34浏览次数:36  
标签:Log Authentication Replicate SSL connection Master mysql master secure

问题描述:mysql从库执行同步后,查看状态显示"Authentication requires secure connection"异常,如下所示:
数据库:mysql 8.0.27
系统:rhel 7.3
1、异常重现
mysql> change master to master_host='192.168.133.111',master_user='repluser',master_password='repluser',master_log_file='mysql-bin.000001',MASTER_LOG_POS=716;
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: Connecting to source
                  Master_Host: 192.168.133.111
                  Master_User: repluser
                  Master_Port: 3306
                Connect_Retry: 60
              Master_Log_File: mysql-bin.000001
          Read_Master_Log_Pos: 716
               Relay_Log_File: mysql-slave1-log.000001
                Relay_Log_Pos: 4
        Relay_Master_Log_File: mysql-bin.000001
             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: 716
              Relay_Log_Space: 156
              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: 2061
                Last_IO_Error: error connecting to master '[email protected]:3306' - retry-time: 60 retries: 1 message: Authentication plugin 'caching_sha2_password' reported error: Authentication requires secure connection.
               Last_SQL_Errno: 0
               Last_SQL_Error: 
  Replicate_Ignore_Server_Ids: 
             Master_Server_Id: 0
                  Master_UUID: 
             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: 230528 19:59:43
     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: 0
            Network_Namespace: 
1 row in set, 1 warning (0.01 sec)

说明:如上所示,查看slave状态时,显示error: Authentication requires secure connection告警.
2、解决方案
在change msater时添加get_master_public_key=1参数,实际操作如下:
--从库执行.
mysql> stop slave;
Query OK, 0 rows affected, 1 warning (0.01 sec)
--清除从库配置.
mysql> reset slave all;
Query OK, 0 rows affected, 1 warning (0.02 sec)
--重新配置主库信息.
mysql> change master to master_host='192.168.133.111',master_user='repluser',master_password='repluser',master_log_file='mysql-bin.000001',MASTER_LOG_POS=716,get_master_public_key=1;
Query OK, 0 rows affected, 9 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: mysql-bin.000001
          Read_Master_Log_Pos: 716
               Relay_Log_File: mysql-slave1-log.000002
                Relay_Log_Pos: 324
        Relay_Master_Log_File: mysql-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: 716
              Relay_Log_Space: 534
              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: 8595bc2f-fd19-11ed-8033-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.01 sec)

说明:Slave_IO_Running: Yes Slave_SQL_Running: Yes,启动正常.

参考文档:https://blog.csdn.net/qun7559/article/details/129226497

标签:Log,Authentication,Replicate,SSL,connection,Master,mysql,master,secure
From: https://blog.51cto.com/u_12991611/6366374

相关文章

  • 解决 Failed to connect to github.com port 443:connection timed out
    晕了,今天不知道怎么出现了这个问题gitconfig--globalhttp.proxyhttp://127.0.0.1:1080gitconfig--globalhttps.proxyhttp://127.0.0.1:1080问题得到解决取消代理gitconfig--global--unsethttp.proxygitconfig--global--unsethttps.proxy我也记不清到底......
  • connection reset by peer 发生了什么?
    一.概述在后台应用开发过程中,许多组件会打出日志,connectiontimeout,connectionresetbypeer,让人一头雾水。timeout通常比较好理解,可能是网络不通。那么connectionresetbypeer呢?二.预备知识为了理解这个问题,我们需要一些tcp连接的基础知识,一个典型的tcp连接如下。t......
  • 1192. Critical Connections in a Network刷题笔记
    参考这个题解,用的dfsimportcollectionsclassSolution:defcriticalConnections(self,n:int,connections:List[List[int]])->List[List[int]]:defmakeGraph(coonections):graph=collections.defaultdict(list)forconnincon......
  • jmeter之JDBC Connection Configuration 请求
    1、下载mysqljdbc驱动包(注:驱动包的版本一定要与你数据库的版本匹配,驱动版本低于mysql版本有可能会导致连接失败报错)我这里下载的是mysql-connector-j-8.0.33.jar下载完后,将jira包放在D:\jmeter\apache-jmeter-5.2.1\lib目录下,这样就jmeter中就有驱动了,重启jmeter  2.线程......
  • git 小白拉取代码遇到2FA拉取代码失败fatal: Authentication failed
    目录git小白拉取代码遇到2FA拉取代码失败fatal:Authenticationfailed2FA认证问题git小白拉取代码遇到2FA拉取代码失败fatal:Authenticationfailed代码仓库开启了2FA认证,在我们gitclone的时候出现如下报错,因为开启后,我们只是单纯的gitclonehttps没法通过FA认证fatal:A......
  • error: RPC failed; curl 55 OpenSSL SSL_write: Connection was aborted, errno 1005
    git初始化上传本地代码到远程出现异常造成的可能原因:1.网络原因2.无效的代理3.一次性推送的代码量过大 解决方法:1.网络原因可以等一段时间网络良好的情况上传2.无效代理的情况如下设置gitconfighttp.sslVerify"false"3.一次性推送代码量过大的情况如下设置,更改推......
  • Cisco Secure Web Appliance Virtual 15.0 发布 - 适用于网络安全的思科高级威胁防护
    CiscoSecureWebApplianceVirtual,AsyncOSforWSA15.0.0LD请访问原文链接:https://sysin.org/blog/cisco-secure-web-appliance-15/,查看最新版。原创作品,转载请保留出处。作者主页:sysin.orgCiscoSecureWebAppliance无惧高级威胁​自动拦截危险网站,在允许用户访问......
  • Caused by: io.netty.channel.AbstractChannel$AnnotatedConnectException: Connectio
    现象:今天在启动项目时,本项目使用了Elasticsearch服务,发现后台报这个错误:Causedby:io.netty.channel.AbstractChannel$AnnotatedConnectException:Connectionrefused:nofurtherinformation:/127.0.0.1:9300错误信息提示如下图:原因:本项目使用了Elasticsearch搜索服务,而报错信......
  • sshpass报错 Permission denied, please try again.和 connect to host localhost po
    最近在做自动化时,自动化脚本用sshpass给远程机器发送命令(sshpass-p"123456"ssh-p10022root@localhost-oStrictHostKeyChecking=no"poweroff")报错:Permissiondenied,pleasetryagain.和 ssh:connecttohostlocalhostport10022:Connectionrefused   1.......
  • git指令连接库失败:OpenSSL SSL_read: Connection was reset, errno 10054
    一、问题描述无论是gitclone还是gitpush之类的需要连接库的指令都会出现`fatal:unabletoaccess'http://github.com/我的库/':OpenSSLSSL_read:Connectionwasreset,errno10054`报错原因:字面意思:服务器的SSL证书灭有经过第三方机构的签署。网上信息也有的说可能......