I need to execute a mysql query in one line using bash.
It should be something like this:
mysql database --user=\'root\' --password=\'my-password\' <
Use the -e option:
-e
$ mysql -e "UPDATE ..."