---
title: 在x86服务器上部署MySQL主从复制时提示无法验证身份的解决方法
description: "在x86服务器上部署MySQL主从复制的过程中，配置从库时运行start slave;后提示如下信息。"
url: https://www.hikunpeng.com/document/detail/zh/kunpengdbs/ecosystemEnable/MySQL/kunpengdbs_mysql_bestpractices_21_0019.html
sourcePath: /source/zh/kunpengdbs/ecosystemEnable/MySQL/kunpengdbs_mysql_bestpractices_21_0019.html
indexId: e2eef9351e6c88dbe7f97931b458f68f9e9f47c5f0cb7918a042695d909fd73287
---
# 在x86服务器上部署MySQL主从复制时提示无法验证身份的解决方法

#### 问题现象描述

在x86服务器上部署MySQL主从复制的过程中，配置从库时运行start slave;后提示如下信息。

```
Authentication plugin 'caching_sha2_password' reported error: Authentication requires secure connection. Error_code: MY-002061
```


#### 关键过程、根本原因分析

当前客户端没有保存服务端的RSA公钥文件，导致服务端无法验证身份。


#### 结论、解决方案及效果

1. 停止主从复制。
  1 stop slave;

2. 将--get-server-public-key=1添加至change master命令中，向服务端请求公钥文件。
  1 change master to master_host='192.168.0.1',master_port=3306,master_user='replicate',master_password='123456',master_auto_position=1,get_master_public_key=1;

  192.168.0.1为主库的IP地址，请根据实际情况修改。

3. 重新启动鲲鹏从库的复制进程，并检查从库的状态以确保复制正在运行。
  1 2 start slave; show slave status\G;
