MySQL Access log query Execution

We are trying to upgrade our MySQL servers from 5.7.26 to MySQL 8. We want to test all the queries which were executed in say 48 hours in the old MySQL instance, To execute on a new Instance with MYSQL 8 and capture errors if any. There are millions of queries got executed in the past 48 hours, What will be the best possible solution to achieve what we are looking for?


To show the queries log in MySQL below steps can be followed:

  1. Enable Query logging on the database. SET global general_log = 1; SET global log_output = 'table';
  2. Now you can view the log by running this query: SELECT * FROM mysql. general_log;
  3. If you want to disable query logging on the database, run this query: SET global general_log = 0;

You can refer to doc[1] to know more informationm about MySQL 8.0

[1] https://dev.mysql.com/doc/refman/8.0/en/query-log.html