If the mysql configuration for history files was not changed then mysql by default stores the list of command used at the CLI (Command line interface) prompt in the file ~/.mysql_history
As a security precaution if the CLI is used to set passwords clear the history after using the CLI by deleting this file ~/.mysql_history