I'd like to execute this and check if count is 0, 1 or > 1 in bash.
mysql -e "select count(*) from mydb.mydb;"
The output is:
+----------+
| count(*) |
+----------+
| 0 |
+----------+
I don't know how to parse this. Also this will be used in a cron job, so I can't have any output.
Best Answer
You could suppress the tab column name by:
Also, the semicolon at end your SQL command is unnecessary