MySQL Shell 9.7

6.5 Resetting Internal Replication Account Credentials

reset_replication_accounts_password() enables you to reset, or recreate, the credentials for the internal recovery and replication accounts used in your Cluster, ClusterSet, or ReplicaSet.

This function has the following syntax:

      topology.reset_replication_accounts_password([options])
    

The function can be run with or without options. If run without options, it resets the passwords of all internal replication accounts. For example:

cluster.reset_replication_accounts_password()
* Verifying Cluster 'devCluster' status
* Resetting replication accounts of Cluster 'devCluster'...

The replication account passwords of all the Cluster instances were successfully reset.
    

The following options are available:

The following example shows the recreate option:

cluster.reset_replication_accounts_password({"recreate":"true"})
* Verifying Cluster 'devCluster' status
* Recreating replication accounts of Cluster 'devCluster'...

The replication account passwords of all the Cluster instances were successfully recreated.
    

Topology Notes

This section describes topology-specific notes for the reset_replication_accounts_password() function:

  • Cluster

    • If cluster.reset_replication_accounts_password() is run on a Cluster which belongs to a ClusterSet, it fails and returns a message instructing you to run clusterset.reset_replication_accounts_password().

  • ClusterSet

    • Skips Clusters whose globalStatus=INVALIDATED and fails if any member Cluster has a global status which is not OK. This condition cannot be overridden by the force option.

    • Synchronizes replication on eligible Replica Clusters before applying credential changes.

    • Fails if any required Cluster or instance is unreachable, unless force:true.

  • ReplicaSet

    • Operation fails if members are not reachable, unless force:true.