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
Post a Comment