Enable Query Auditing in MySQL
If you're looking to monitor and log all queries executed on your MySQL database for an hour, you can turn on audit logging.
Audit Logging Configuration
To enable audit logging and dump the log to a file, execute the following commands in your MySQL console:
SET global log_output = 'FILE'; SET global general_log_file='/Applications/MAMP/logs/mysql_general.log'; SET global general_log = 1;
This will configure the database to write all queries to the specified log file. After an hour, you can stop logging by executing:
SET global general_log = 0;
Disclaimer: All resources provided are partly from the Internet. If there is any infringement of your copyright or other rights and interests, please explain the detailed reasons and provide proof of copyright or rights and interests and then send it to the email: [email protected] We will handle it for you as soon as possible.
Copyright© 2022 湘ICP备2022001581号-3