Skip to content

Instantly share code, notes, and snippets.

@seeker815
Forked from vishnuhd/mysql-client-k8s.md
Created April 17, 2022 08:15
Show Gist options
  • Save seeker815/682e65f48eba5669ee08419723d809cc to your computer and use it in GitHub Desktop.
Save seeker815/682e65f48eba5669ee08419723d809cc 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