Delete Unwanted Logs Master Slave Log
PURGE BINARY LOGS BEFORE '2019-06-08 00:00:00';
folder /var/lib/mysql
No Sleep Query Required
SELECT * FROM information_schema.processlist WHERE
COMMAND LIKE 'query%' ORDER BY TIME DESC;
Spot slow queries
Perhaps you didn't realise this, but simply by enabling one option in your MySQL configuration file, MySQL will keep a log of all the queries it considers slow (usually taking longer than ten seconds to execute), as well as how many rows the slow query returned.To activate the slow query log, simply start up MySQL with the option --log-slow-queries = /var/log/wherever/you/want/it. You can optionally also use --log-long-format, which will cause MySQL to consider all queries that don't use indexes as slow queries - this can be a great help if you are trying to add indexes, but you are not sure where they are needed.
No comments:
Post a Comment