MySQL query history

cat ~/.mysql_history

Save history to database table:

  1. SET GLOBAL log_output = 'TABLE';
  2. SET GLOBAL general_log = 'ON';
  3. SELECT * FROMĀ mysql.general_log;

Save history to file:

  1. SET GLOBAL log_output = "FILE";
  2. SET GLOBAL general_log_file = "/tmp/mysql_query.log"
  3. SET GLOBAL general_log = 'ON';
  4. tail /tmp/mysql_query.log