I've just found a one liner to mirror a local mysql database on a remote server, over ssh:
mysqldump -uroot -proot zedatabase | ssh -p4551 firstname.lastname@example.org "mysql -udoom -pmySqlPassword zedatabase"
This is very handy, but something intrigues me:
is it secure to pass the mysqlPassword in the command? (But if I just leave the -p mysql option without explicit password, the command doesn't work)
What are the risks there, I mean, I know that someone which has access on my local machine will be able to access the password through the history;
but apart of that, can anyone else capture the output of the command (with a middle man attack or something like that), or is it ssh encrypted?