https://dev.mysql.com/doc/refman/5.7/en/mysql-logging.html
On Unix, mysql writes the statements to a history file. By default, this file is named .mysql_history in your home directory. To specify a different file, set the value of the MYSQL_HISTFILE environment variable.