When I want to access a Mysql server which only lets local accesses, first I need to SSH to that server and then run “mysql” command. However I want to run it by one command.
When I execute this command terminal stops and the cursor gets frozen after 5 or 10 seconds.
ssh arash@10.0.3.1 "/usr/bin/mysql -u db_username -pdfdasdfCASDF -D db_12dgj
Does anyone know which part is wrong?
You need to make sure you got a pty for readline. Use the
-toption ofssh.man ssh(1):
-t Force pseudo-tty allocation. This can be used to execute arbi- trary screen-based programs on a remote machine, which can be very useful, e.g., when implementing menu services. Multiple -t options force tty allocation, even if ssh has no local tty.