I know how one can execute MySQL queries / commands from bash:
mysql -u[user] -p[pass] -e "[mysql commands]"
or
mysql -u[user] -p[pass] `<<`QUERY_INPUT
[mysql commands]
QUERY_INPUT
How can I capture how many rows were affected by the query?
I tried doing:
variable='`mysql -u[user] -p[pass] -e "[mysql commands]"`'
It does execute the command but it does not return the number of affected rows.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…