Manage passwords

Charmed MySQL user credentials are managed with Juju’s get-password and set-password actions.

See also

Users

Get password

To retrieve user credentials for the root user, run the get-password action on the leader unit as follows:

juju run mysql/leader get-password

To retrieve credentials for a different user:

juju run mysql/leader get-password username=<username>

Set password

To change the root user’s password to a new, randomized password:

juju run mysql/leader set-password

To set a manual password for the root user:

juju run mysql/leader set-password password=<password>

To set a manual password for another user:

juju run mysql/leader set-password username=<username> password=<password>