1. Get the embedded database password of the labfolder user:
sudo kubectl get secret labfolder-labregister-chart-mysql -o jsonpath='{.data.mysql-password}' | base64 --decode
a) Optionally, get the root password:
sudo kubectl get secret labfolder-labregister-chart-mysql -o jsonpath='{.data.mysql-root-password}' | base64 --decode
2. Connect to the MySQL POD:
sudo kubectl exec -i -t labfolder-labregister-chart-mysql-0 -c mysql -- sh -c "(bash || ash || sh)"
3. Log on to the MySQL database:
mysql --user labfolder -p
Alternatively, executing SQL queries with a single command directly from the terminal is possible. For example, this command will get all Labfolder users:
sudo kubectl exec -i -t labfolder-labregister-chart-mysql-0 -c mysql -- mysql --user labfolder -p"<my-password>" -e "select id, email, firstName, lastName from labfolder.user;"
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article