diff --git a/recover_innodb_cluster.md b/recover_innodb_cluster.md index 99d40c8..efeaa6f 100644 --- a/recover_innodb_cluster.md +++ b/recover_innodb_cluster.md @@ -47,6 +47,31 @@ mysql-innodb-cluster/2* active idle 2/lxd/6 10.0.1.156 Check the mysql status: `sudo systemctl status mysql` +1. A temporary password would have been created via the `--initialize` above, so this needs to be updated. + You will find the temporary password in `/var/log/mysql/error.log`, and the line should look similar to the one below + + ``` + [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: wyPd_?kEd03p + ``` + + First we need to get the root password that is stored + + ``` + juju run --unit mysql-innodb-cluster/leader 'leader-get mysql.passwd' + ``` + + Now, we can update the password, login using the password that was suggested in the error.log i.e. `wyPd_?kEd03p` + + ``` + mysql -p -u root + ``` + + Once logged in, we can update the password to the value that mysql-innodb-cluster charm knows about + + ``` + ALTER USER 'root'@'localhost' IDENTIFIED BY 'zn8K73dmqnkZd99JZxXwcFmxWqTxPYgw3Hjx5sk'; + ``` + 1. Remove the flags using Juju: Clear flags to force charm to re-create cluster users