From 7a7938e191c48ce382b1ef0f28f4d981cf844568 Mon Sep 17 00:00:00 2001 From: Fernando Laudares Camargos Date: Mon, 23 Sep 2024 11:37:27 -0300 Subject: [PATCH] Update users.md The MySQL root password is no longer available as an environment variable inside the container. I provide a two-step approach that consists in grabbing the password from the secrets file first and storing it in a local env; maybe we want to provide a more detailed explanation instead. --- docs/users.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/users.md b/docs/users.md index 6201a16d..f95c00f0 100644 --- a/docs/users.md +++ b/docs/users.md @@ -16,7 +16,8 @@ There are no unprivileged (general purpose) user accounts created by default. If you need general purpose users, please run commands below: ``` {.bash data-prompt="$" data-prompt-second="mysql>"} -$ kubectl run -it --rm percona-client --image=percona:8.0 --restart=Never -- mysql -hcluster1-pxc -uroot -proot_password +MYPASS=`kubectl get secrets cluster1-secrets -o yaml|grep "root:"|awk -F": " '{print $2}'| base64 -d` +$ kubectl run -it --rm percona-client --image=percona:8.0 --restart=Never -- mysql -hcluster1-pxc -uroot -p$MYPASS mysql> GRANT ALL PRIVILEGES ON database1.* TO 'user1'@'%' IDENTIFIED BY 'password1'; ```