我要评分
获取效率
正确性
完整性
易理解

Authentication Error Occurs When MySQL Primary/Secondary Replication Is Deployed on an x86 Server

Symptom

During the MySQL primary/secondary replication deployment on the x86 server, the following information is displayed after start slave; is run for configuring the secondary database:

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

Key Process and Cause Analysis

The RSA public key file of the server is not saved on the current client. As a result, the server fails to authenticate the identity.

Conclusion and Solution

  1. Stop the primary/secondary replication.
    1
    stop slave;
    
  2. Add --get-server-public-key=1 to the change master command to request the public key file from the server.
    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 is the IP address of the primary database server. Change it based on the actual IP address.

  3. Restart the replication process of the Kunpeng secondary database and check its status to ensure that the replication is running.
    1
    2
    start slave; 
    show slave status\G;