Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I currently have an alias to connect to a remote server:

alias server='ssh user@ec2-00-00-00-000.compute-1.amazonaws.com'

I would like to have an alias to connect to this server, and then automatically open mysql terminal.

Currently, I connect to the server and then run:

mysql

manually.

Is there anything like:

alias serverdb='ssh user@ec2-00-00-00-000.compute-1.amazonaws.com && mysql'

but to be executed on the remote server?

share|improve this question
add comment

1 Answer 1

up vote 2 down vote accepted

Leave off the &&. It probably will work better if you force a tty as well (the -tt below).

alias serverdb='ssh -tt user@ec2-00-00-00-000.compute-1.amazonaws.com mysql'
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.