---
# System prepended metadata

title: K8s mysql conn

---

# K8s mysql conn

```
curl https://sdk.cloud.google.com | bash
gcloud components install kubectl
gcloud auth login
gcloud auth application-default login
gcloud config set project karmaksana-stage
gcloud compute instances list
gcloud container clusters get-credentials kmk-stage --zone asia-east1-b
kubectl get po

kubectl logs -f account-backend-56f587f764-npb67 --tail 30

kubectl get po
kubectl exec -it stage-db-mysql-0 bash
Then MySQL conn

kubectl get svc
kubectl port-forward svc/stage-db-mysql 3306:3306
Then MySQL conn
```