天天看點

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';

4. Confirm you can log in to MySQL witrh the repluser

              mysql -u repluser -p -h HOSTNAME