MYSQL: How to check exit status?
问题 I've a problem with mysql remote connections. One server located in USA, the other located in Netherlands and the connection between them is horrible, especially in the evenings. I managed to solve the select query by setting a timeout done < <(mysql --connect_timeout=10 --batch -e "${selectQ}" -u${user} -p${password} ${database} -h ${host}) but I don't know how to solve update query, as it should be send only once. echo "UPDATE table set field='1' WHERE id='${id}'" | mysql -u${user} -p$