Truncate Slow Query Log in MySQL
问题 What's the safest way to truncate the MySQL slow query log (under Linux primarily, but Windows would be handy to know) while MySQL is running? By safe I mean: Mustn't cause any permissions problems Mustn't jump back to its original size next time its appended to 回答1: To truncate a file regardless if it is open by a running application do: > /var/logs/your.log at your shell prompt. 回答2: From here: You can move the open file, then tell mysqld to flush logs, which will open a new log. shell> cd