CMD="use metadata; select * from usernames; select * from personData; select usernames.SNo,
usernames.DataTelid, usernames.UName, personData.ActiveInactive from usernames, personData where usernames.DataTelid=personData.DataTelid into outfile '/tmp/querydb';"
ssh [USER-NAME]@[REMOTE-HOST]
mysql -h HOST -u USERNAME -pPASSWORD -e "$CMD" < /tmp/querydb
From server A, I login to server B which has the mysql database. The querydb file is snot suppose to be created on server B but server A. I am stuck and how to go about this?