Roland Seuhs Roland Seuhs - 10 months ago 76
MySQL Question

How to search in the mysql command history

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 search for a string like you can do in (for example) bash?

In bash you can do:

history | grep "command"

Is there something similar in mysql?

Answer Source

Usually this lists up all MySQL commands that have been used:

less ~/.mysql_history