Skip to content

Instantly share code, notes, and snippets.

@vishnuhd
Created August 22, 2019 13:21
Show Gist options
  • Save vishnuhd/b8686197f855c00fa734bc5f1fedf078 to your computer and use it in GitHub Desktop.
Save vishnuhd/b8686197f855c00fa734bc5f1fedf078 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.

@initdude
Copy link

sounds good, but how to run a mariadb pod with mysql client in it?

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