Skip to content

Instantly share code, notes, and snippets.

@tan-i-ham
Forked from vishnuhd/mysql-client-k8s.md
Created March 10, 2023 03:46
Show Gist options
  • Save tan-i-ham/8ccff85e90ab8febb19830dedc80a42d to your computer and use it in GitHub Desktop.
Save tan-i-ham/8ccff85e90ab8febb19830dedc80a42d to your computer and use it in GitHub Desktop.
mysql-client in Kubernetes to test your connection to mysql server

mysql-client in Kubernetes to test your connection to mysql server

kubectl run mysql-client --image=mysql:5.7 -it --rm --restart=Never -- /bin/bash

mysql -h mysql-service -uroot -proot_password -e 'SHOW databases;'

OR

mysql -h mysql-service -uroot -proot_password

then use your mysql queries and commands as usual.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment