When using a bash script to execute remote MySQL queries, how can I know if the command was successful or not. Locally it would return an exit code. However, remotely it seems to send the query and if it is able to connect to the remote MySQL database it takes it as successful. Is there any way to view the output when executing remotely, like when executing locally. Here is the script:
#!/bin/bash
RemoveID=`mysql -u root -proot -h 192.168.1.56 -e "delete from table where ID = '$1'"`