Last active
January 24, 2019 14:51
-
-
Save AmreeshTyagi/ca87183d29fa3217b7487ceb17c275f4 to your computer and use it in GitHub Desktop.
mysql 8.0 caching_sha2_password fix for kubernetes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Please change values of <> placeholders as per your requirments. | |
# Step 1: Get mysql password from kubernetes pod, if installed from helm. | |
MYSQL_ROOT_PASSWORD=$(kubectl get secret --namespace <my-namespace> <mysql-secret-key> -o jsonpath="{.data.mysql-root-password}" | base64 --decode; echo) | |
# Step 2: Run mysql client in kubernetes | |
kubectl run -it --rm --image=mysql:8.0 --restart=Never mysql-client -- mysql -h <mysql-host> -u root -p$MYSQL_ROOT_PASSWORD | |
# Step 3: Run following query to chnage password method | |
# ALTER USER 'yourusername'@'localhost' IDENTIFIED WITH mysql_native_password BY 'youpassword'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment