8.0.19mysql主从复制账号连接问题

ERROR 2061 (HY000): Authentication plugin 'caching_sha2_password' reported error: Authentication requires secure connection.

 

1. Remove the repluser
            drop user 'repluser'@'HOSTNAME';
             flush privileges;

2. Confirm the repluser has been dropped
           select user from mysql.user;

3. Manually create the user with the hostname and IP address
             create user 'repluser'@'HOSTNAME' identified with mysql_native_password by 'PASSWORD';
             create user 'repluser'@'IP' identified with mysql_native_password by 'PASSWORD';
             GRANT REPLICATION SLAVE, REPLICATION CLIENT, SELECT, LOCK TABLES, RELOAD ON *.* TO 'repluser'@'HOSTNAME';
             GRANT REPLICATION SLAVE, REPLICATION CLIENT, SELECT, LOCK TABLES, RELOAD ON *.* TO 'repluser'@'IP';
             flush privileges;

4. Confirm you can log in to MySQL witrh the repluser
              mysql -u repluser -p -h HOSTNAME

posted @ 2021-11-02 11:36  learnnote  阅读(192)  评论(0)    收藏  举报