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:
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
- Stop the primary/secondary replication.
stop slave;
- Add --get-server-public-key=1 to the change master command to request the public key file from the server.
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.
- Restart the replication process of the Kunpeng secondary database and check its status to ensure that the replication is running.
start slave; show slave status\G;
Parent topic: Troubleshooting