bash command to connect to mysql and query; the same select statement works fine when I execute in mysql shell.
mysql --user=abcd --password=1234 --host="rem