bash - how to write a script for connecting to mysql by TCP/IP over SSH? -


as shown in title, want open mysql @ local terminal. wrote 2 lines:

ssh -i pem user@1.1.1.1   #log in server password mysql -h xxx -u user -p  #connect mysql password 

is possible make in 1 line? or can write in script? fresh on bash:)

last part of ssh's synopsis in man page [command].

since mysql screen based program need run ssh -t

this should work:

ssh -t -i pem user@1.1.1.1 "mysql -h xxx -u user -p" 

Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

python - Django-cities exits with "killed" -

python - How to get a widget position inside it's layout in Kivy? -