The mysql command-line client supports a history (you can use the cursor-keys to access and navigate it), but is there a way to access it (for example) in bash?
In bash you can do:
history | grep "command"
Is there something similar in mysql?
You may use Ctrl+R to search the history, as in bash.
Usually this lists up all MySQL commands that have been used:
less ~/.mysql_history
Open the file in vim editor
vi ~/.mysql_history
then you can search the pattern with /
by entering you text.